Hi guys, I need a timebased caching of certain pages. Cache for certain page should be cleared each 15 minutes. Is that possible? In http://edgeguides.rubyonrails.org/caching_with_rails.html manual I see that there is only manual cache clear methods, such as expire_page or expire_action. Regards, Alexey -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 26, 6:33 am, lexer <lexer....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > > I need a timebased caching of certain pages. Cache for certain page > should be cleared each 15 minutes. Is that possible? > > Inhttp://edgeguides.rubyonrails.org/caching_with_rails.htmlmanual I > see that there is only manual cache clear methods, such as expire_page > or expire_action. > > Regards, > AlexeyI don''t think Rails provides time based caching. I also do not think it''s needed. What are you trying to accomplish? Lets say you have a page with list of products that you want to cache. The cache *only* needs to be updated if one of the products changes. Caching the page for an arbitrary amount of time is unnecessary. If you *really* need a time based cache, you could just use a cache, then set the expire action as a cron job that runs every 15 minutes. But really, infinite caching with proper expiration is the way to go. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This depends on the cache store you use. The memcached store can expire cache items after a certain time. See point 4 here: http://guides.rubyonrails.org/caching_with_rails.html#cache-stores On Aug 26, 1:23 pm, Tim Shaffer <timshaf...-BUHhN+a2lJ4@public.gmane.org> wrote:> On Aug 26, 6:33 am, lexer <lexer....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi guys, > > > I need a timebased caching of certain pages. Cache for certain page > > should be cleared each 15 minutes. Is that possible? > > > Inhttp://edgeguides.rubyonrails.org/caching_with_rails.htmlmanualI > > see that there is only manual cache clear methods, such as expire_page > > or expire_action. > > > Regards, > > Alexey > > I don''t think Rails provides time based caching. I also do not think > it''s needed. What are you trying to accomplish? > > Lets say you have a page with list of products that you want to cache. > The cache *only* needs to be updated if one of the products changes. > Caching the page for an arbitrary amount of time is unnecessary. > > If you *really* need a time based cache, you could just use a cache, > then set the expire action as a cron job that runs every 15 minutes. > > But really, infinite caching with proper expiration is the way to go.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.