Hello, I''m trying to figure out how I could implement fragment caching that expires every x amount of time. I thought of writing a runner script that would expire the cache and set it as a cron job, but that doesn''t really work because runner scripts act on models and not controllers. Does anybody have any ideas? Regards, -carl
I was hoping someone would jump in here with the solution. I had the same problem and couldn''t figure it out. I ended up just using a cron job to delete them. Steve http://www.trivionomy.com http://www.smarkets.net On 5/28/06, Carl Lerche <carl.lerche@verizon.net> wrote:> > Hello, > > I''m trying to figure out how I could implement fragment caching that > expires every x amount of time. I thought of writing a runner script > that would expire the cache and set it as a cron job, but that > doesn''t really work because runner scripts act on models and not > controllers. > > Does anybody have any ideas? > > Regards, > -carl > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060531/297829ae/attachment.html
I believe the Typo project has done what you need. Take a look at http://www.typosphere.org/trac/browser/trunk/vendor/plugins/expiring_action_cache/lib/metafragment.rb I''ve been meaning to implement this, but its low on my priority list. cheers, scott ---------------------------------------------------------------------------------------------------- What''s an Intel chip doing in a Mac? A whole lor more that it''s ever done in a PC. My Digital Life - http://scottwalter.com/blog Pro:Blog - http://scottwalter.com/problog Snippets - http://snippets.scottwalter.com ----- Original Message ---- From: Steve Odom <steve.odom@gmail.com> To: rails@lists.rubyonrails.org Sent: Tuesday, May 30, 2006 7:15:44 PM Subject: Re: [Rails] Time-based cache fragment expiration I was hoping someone would jump in here with the solution. I had the same problem and couldn''t figure it out. I ended up just using a cron job to delete them. Steve http://www.trivionomy.com http://www.smarkets.net On 5/28/06, Carl Lerche <carl.lerche@verizon.net > wrote:Hello, I''m trying to figure out how I could implement fragment caching that expires every x amount of time. I thought of writing a runner script that would expire the cache and set it as a cron job, but that doesn''t really work because runner scripts act on models and not controllers. Does anybody have any ideas? Regards, -carl _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060531/3f574ca1/attachment.html
> Hello, > > I''m trying to figure out how I could implement fragment caching that expires > every x amount of time. I thought of writing a runner script that would > expire the cache and set it as a cron job, but that doesn''t really work > because runner scripts act on models and not controllers. > > Does anybody have any ideas?I haven''t done extensive testing, but we use memcache to store sessions/fragments and with some minor tweaks you can pass along an expiration time (ie. expire automatically in 10 minutes)... The automatic expiration is a part of memcache... if you''re interested let me know and I''ll write it up. -philip