OpenCart modules - how to clear cache or disable Opencart 3.0 caching
The version of OpenCart 3.0 allows, thanks to the actively used Twig template engine, to cache. When php was involved, there were no such opportunities. And the system remembering its actions increased the load on the hosting server. This negatively affected the loading speed of Internet resources. But every action has its pros and cons. Let's try to figure them out.What is caching and why is it used in OpenCart
Caching allows not only to remember, but also to reflect the Internet platform or part of it. This reduces the number of hits to the resource database. This means that it also reduces the load on the hosting server. This means that when you call some data or a dynamic page, the system is able to save its static copy. Then, when any user wants to see this data, it is shown from the resource's cache. As a result, calling a static, memorable page is several times faster than dynamic data.
But there is also a minus. If changes are made to the site code through OpenCart, they will no longer be displayed in the cache. And after making adjustments on the resource, it should be cleared from caching. This will clear the memory of the generated pages and their components and make it possible to display updated files and extensions of the system itself.
Clearing the cache is available in Opencart in several ways:
- By installing a special module. It is offered on the site opencart3x.ru absolutely free.
- Through the admin panel in the resource control panel. This action is performed in several steps. In the administrative part of the resource, go through the “gear”, and in the window that pops up, find the phrase Template cache and click the Update button.
- Hosting or FTP client. In the hosting manager file or the storage / cache / folder, delete everything inside. If you can't find the folder quickly, you should take the time to find it.
Usually, resource developers know that after installing Opencart, they should move the storage / cache / folder above the folder with the Internet resource. If it turned out to be difficult to find Storage / Cache, you should go to config.php, which is located at the root of the site. DIR_STORAGE should remain there.
Disabling cache in Opencart: 2 ways available
Sometimes a developer decides to disable caching. You can do this in 2 ways:
In the admin panel
In order to disable the cache in the administrative panel of the resource, you should:
- Go to the main admin page.
- Find the gear icon in the upper right corner.
- Press it.
On the site server
In order to reset the site cache, you should:
- Log in to the server.
- Find the system/library/template/twig.php file on it.
- Find the cache line in it.
- Comment out or remove the line $config['cache'] = DIR_CACHE.
Using or disabling the cache is a personal matter for each developer. Creating a site on OpenCart significantly "simplifies the fate" of the owners of Internet resources who understand or try to understand their structure and change it for the better. This is greatly helped by modules from opencart3x.ru. Moreover, the development for clearing the cache is provided to our customers absolutely free of charge. You can download the required module from our website.
Our technical support works 24/7. And, if customers still have questions and suggestions about improving the cache clearing module in Opencart, they can always be asked / written to specialists.