Magento 1.9 – How to Completely Disable Cache for Development

cachingmagento-1.9

I am developing a script which is in the skin folder.
I lost many hours because of the weird caching mechanism of Magento.

I already disabled all the caches in the backend, but it still caches.
I opened the developer console and enabled "disable cache" in the browser, but it makes no difference.

It does not use the latest script file, even if I empty the var/cache folder.

I also cleared the Javascript/CSS cache and every possible cache.

How on earth should I develop if it caches so hard? I always have to wait about 1-2 minutes until the file is loaded instead of the cached one.

Is it possible to completely turn it off?

Best Answer

Magento 1.9 doesn't have such a rigerous caching mechanism by default as Magento 2 does, so you should be able to load the new JS file by just clearing the cache from the backend or by disabling it completely.

But if this is not casued by Magento's internal cache or the browser cache, then it might be a reverse proxy cache like Varnish or Apache's mod_cache that is providing the old JS file for a certain period of time (1-2 mins like you said) before it is invalidated and refreshed.

This would be a misconfiguration of the reverse proxy. If your server really is using a reverse proxy I suggest disabling it for development purposes, because you'll experience many issues like this while you develop the site (which is a huge time waster and nerve destroyer).

Also just to be safe, I'd recommend trying with a different browser and/or actually clearing the browser cache after a file is changed, since your browser installation might be corrupted and the disable browser cache functionality in developer tools might be bugged.

Related Topic