Magento 1 – disable cache from database
In this post I show you how to disable cache from database for Magento 1. This is sometimes necessary if all frontend and adminhtml sites are broken and returning a report or error message. If you are confronted with such a problem, relax! It is easy to disable various caches from database.
Magento 1 – disable cache from database
I had the problem, that on a development system every site returned a error message and a created report. There I found the following error message:
1 | Cannot send headers; headers already sent in /app/code/core/Mage/Core/Model/Config.php |
This was quite interesting, because most sites only generated the error if I called it a second time. So it was obvious, that it was a problem with caching sites. This development system was a recent clone from live system. It was possible, that someone forgot to disable caches. What now? If I cleared caches from command line:
1 | rm -rf var/cache/* |
It shows some sites again.
Database
It was not possible to log into adminhtml without an error, so there was only one option last…the database. All of the cache information is stored inside a table named
core_cache_option. The content of this table looks as follows:
Every line is a cache option and the value 0 and 1 indicates if it is turned on (1) or off (0). In my case, most caches were turned on, so I replaced all 1 to 0. This finally fixes my problem for development system.
Conclusion
I showed you how to disable cache from database. The core_cache_option table stores information on which cache is active or disabled and it is possible to edit it directly from you SQL IDE. You should ever deactivate all caches on your development system because caches can influence your testing and this can cause confusion for you as developer!
What do you think about it? Are there other solutions? What about Magento 2?