Changes made to the website or a PHP script are not visible when accessed through the browser. What is the cause?
In some situations, any changes made to the website will not be visible when accessed through a browser. Find out what the problem could be.
This problem is usually caused by the PHP accelerator OPcache. OPcache improves PHP performance by storing the bytecode (compiled PHP code) in memory, thereby eliminating the need to load and parse PHP scripts for each request.
Changes made to PHP scripts are refreshed in memory according to the value of the directive opcache.revalidate_freq. For this reason, there may be delays until the changes become visible on the site.
How to disable OPcache:
OPcache can be disabled by following these steps:
- Access cPanel.
- Navigate to the Select PHP Version section.
- Select Switch to PHP Options.
- Set the directive
opcache.enableto Off.
For additional information, please consult the available tutorials:
Note: OPcache significantly improves the execution speed of PHP scripts, and it is recommended to be disabled only during the development of the website or application.
Other possible reasons why the changes are not visible:
- Cache in browser: The browser may keep an outdated version of the page. Try clearing the cache or reloading the page using the key combination
Ctrl + F5. - Application cache: Most CMSs, such as WordPress, Joomla, or PrestaShop, include their own caching mechanisms.
- Check the application's administration settings to clear the cache.
- Make sure that caching mechanisms are not active during development.