Forum: Ruby on Rails RE: per user cache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tom (Guest)
on 2005-12-06 02:47
(Received via mailing list)
Take a look at the documentation for fragment caching here:
http://rails.rubyonrails.com/classes/ActionControl....
html



I think you could do something like this in your view to cache the
weather results for each Zip code:



<% cache(:action => "list", :action_suffix => @user.zipcode) do %>
...








________________________________

From: Adam D. [mailto:removed_email_address@domain.invalid]
Sent: Monday, December 05, 2005 9:41 AM
To: removed_email_address@domain.invalid
Subject: [Rails] per user cache



Hello,

 I have a dynamic website that i want to cache a piece of per user.
There is a part of the page that makes a call to Yahoo Weather to pull
the information down.  Instead of making that call for every page load
(same idea with google maps), i would like just to cache that fragment
of the page.  However each user has a different zip so i need to cache
this on a per user level.

Is this possible?

thanks
adam
straightflush (Guest)
on 2005-12-06 18:29
(Received via mailing list)
does this need to be explicitly turned on in development? Its not
workign so
far for me.

thanks
adam
alltom (Guest)
on 2005-12-06 22:26
(Received via mailing list)
On 12/6/05, Adam D. <removed_email_address@domain.invalid> wrote:
> does this need to be explicitly turned on in development? Its not workign so
> far for me.

I believe that caching is disabled in development mode. Or do you mean
that it's 'not working' in a different way?

> thanks
> adam

Sincerely,

Tom L.
removed_email_address@domain.invalid
http://AllTom.com/
This topic is locked and can not be replied to.