Up until now, I always restarted memcache to clear it. However, you can make a rake task to do so:
1 namespace :cache do
2 desc 'Clear memcache'
3 task :clear => :environment do
4 ActionController::Base.cache_store.clear
5 end
6 end
Drop this into /lib/tasks/cache.rake. Now just run the task:
1 rake cache:clearThis only works if you have configured action_controller.cache_store to be memcache.
Have a good weekend!
2 comments:
thank you very much,
it was very helpful for me.
I've experienced problems with cache on stage server.
And clearing cache using you task fixed the problem.
Sincerely,
Igor,
CEO at http://www.mytaskhelper.com
thank you for you task. Very helpfull !
Post a Comment