Hello,
I am trying to figure out if there is an appropriate and for that
matter, already built-in way to expire an entire directory of cache
fragments. My app has certain situations where an entire subdirectory
in the cache becomes obsolete at once - rather than expiring each file
one at a time, or using a regexp to iterate over the whole thing, it
would be nice to just make the whole directory go poof.
I realize I could to this manually, but it feels like there is
something evil about not using expire_fragment() to get rid of
something that was made by cache(). For example, I could compute the
dir manually, and call
system(“rm -rf #{dir}”). Any reason not to do that?
And even slicker solution would be
File::rename(dir, uniq_filename(‘tmp/old_caches_’))
and then let a cron job “rm -rf tmp/old_caches_*” out-of-band.
Can anyone think of a reason not to do this, or in general a good
reason not to get rid of cache files w/out using expire_fragment?
Thanks,
-Avram
So, if there was nobody else when God said “Let there be light,” was
He talking to Himself? Does that mean He is insane? Because that would
explain a lot