On Nov 4, 2005, at 9:30 AM, Scott Walter wrote:
> I am trying to figure out a way to call the
> expire_fragment outside of a controller. I need to
> expire some fragments on a hourly basis. I have a
> Thread that every hour that will perform a task. The
> expire_fragment is located in the module
> ActionController::Caching::Fragments as an instance
> method.
>
> Do I need to mixin the model
> ActionController::Caching::Fragments into my class?
> Or is there some other way?
>
> thanks,
>
> scott.
Scott -
I am doing the same sort of thing on my site(in my sig) that
needs to expire the cache every 1.5 hours. The best solution I came
up with is a cron job that uses script/runner to expiry the cache. It
works great and you don''t need any ruby threads hanging around
potentially causing errors. Something like this that is a repetitive
time operation is what cron and friends are good at. Right tool for
the right job and all that.
Cheers-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org