views:

23

answers:

2

Hi, I am page caching a list of products - products.json in the public directory under the rails root. I don't add or delete this data through a controller action. This data is loaded into the database through a data migration script. In the development environment I delete this file from the public directory and restart the mongrel server but it is still pulling up the cached data. Not sure from where. How do I expire this cache data.

thanks much, ash

A: 

Have you tried?

rake cache:clear

I am using 2.3 and there is no such rake task. what does it do?
A: 

You have to figure out where the data is being cached. Are you sure that, after you delete the cached version from /public, the data you see on the website is in fact getting pulled from the cache? Because if the base data have not changed, then of course it will recache it the moment is it re-requested (that's how page caching works, if the cache isn't present it regenerates it).

Also, note that there are different data stores available for caching: disk, memory, and more complex solutions (like Memcached). If you see differences between development and production, it could be that you are caching in different places in different environments.

If you want something that will really trash cached files on disk, you may want to try http://github.com/factore/cache_trasher

adriandz