Time-based cache fragment expiration

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

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 O. [email protected]
To: [email protected]
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 L. <[email protected] > 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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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

I’ve done it with using MemCached as a cache backend and described it
here:

http://blog.innerewut.de/articles/2006/02/09/time-based-fragment-caching-with-memcache

Jonathan