Unchecking PHP OpCache Support, Cloudfare does not disable caching

Hello Forum;

Question: Can someone tell me how to disable cache for my website?

The PHP OpCache Support box is unchecked for a domain for a VPS Basic hosting. The PHP Info page says that Zend OPcache is up and running.

The Enable Cloudfare on this domain is also unchecked.

The website is caching pages with error messages. A couple of days ago it was showing database records that had been deleted.

I believe the OPcache caches compiled PHP script bytecode to speed up execution. Unless your PHP scripts are being constantly rewritten, the OPcache shouldn’t be a problem.

By default, DH sets pages to cache for 10 minutes with the Cache-Control header:

Cache-Control: max-age=600

I think you can turn off this default caching via .htaccess. See: https://help.dreamhost.com/hc/en-us/articles/216363157-How-can-I-cache-my-site-with-an-htaccess-file-

Alternatively you can adjust the HTTP cache headers in PHP See articles like: https://stackoverflow.com/questions/13640109/how-to-prevent-browser-cache-for-php-site

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.