PHP Cache Control This note describes We check the date value in that header against the modification date of the executed PHP script file itself.The PHP header function sends the header to the browser in the same order as it occurs in the PHP code. header (Pragma: no - cache Php Header No Cache. Parameters string the header string there are two special. Return values returns the current setting of session cache expire the value returned should be read in minutes defaults to 180. The cache-control header for .php files works great and is set automatically: cache-control: no-cache, must-revalidate, max-age0 expires: Wed, 11 Jan 1984 05:00:00 GMT (By the way: Where does nginx get the information for the cache-control header for the .php-files?) Provided that all caches in the path will obey these directives, this is the way you can do it. I am also assuming you are using Apache and have access to .htacces file. Edit the .htacces file and add this lines The response also specifically says not to cache the response via the Cache-Control: no-cache header.fastcginocache nocache Dont save to cache based on nocache . Regular PHP-FPM stuff: include fastcgi.conf fastcgiparams for nginx < 1.6.1. Remember that usually, there are no caching headers sent for PHP files.
Youll have to take care of sending the correct headers inside your PHP script! Cheers oracle certified professional for the reminder. Pragma: no-cache. Last-Modified: Sun, 20 Jun 2010 05:02:24 GMT. Content-Type: text/html charsetUTF-8. and then cachedThe fix is simpler than you may imagine. Instead of using wp-blog-header directly, like so: requireonce("diary/wp-blog- header.php") The second optional httpresponsecode force the HTTP response code to the specified value.Many proxies and clients can be forced to disable caching with:
Controlling how web pages are cached is basically done using 2 kind of headers: Expires and Cache-Control. Using the Expire header is really simple. It tells when the page the browser or the proxy downloaded should be fetched again from the web server. Try this. . Using HTTP Headers. A better approach is to use the HTTP protocol itself, with the help of PHPs header function, to produce the equivalent of the two HTML meta tags above: php header(Expires: Mon, 26 Jul 1997 05:00:00 GMT) header(Pragma: no- cache) PHP cache cache header Ive been through over 100 answers here, lots to try, NOTHING working?? Have a PHP based site. I need caching OFF for all .php files EXCEPT A SELECT FEW. ?> That was basically the method I used to refresh, but even with this method, it still came down to a cache problem. So, to make a long story short, is there a way to clear the cache without using the php "header" in order to avoid the errors when the page is included in another page? Sample HTTP Headers: (for this page) HTTP/1.