0

My PHP site's HTML <head> tag includes:

<meta http-equiv="Cache-Control" content="max-age=300"/>

Yet the headers show:

 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
        check=0
    Pragma: no-cache

I can't find anywhere in the PHP site that I've inherited that is disabling the cache (I did a full file-content search for "cache" and did not find anything relevant).

I'm not sure where else to look, so I wanted to ask what are all the different ways that caching can be disabled in a PHP site?

ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82
  • Don't use the meta cache control, as it's useless. [Rather use header tags](http://stackoverflow.com/questions/1971721/how-to-use-http-cache-headers-with-php) – h2ooooooo Sep 25 '12 at 12:04

1 Answers1

0

Put the following at the top of the page - if this fixes it - then maybe check your .htaccess or somewhere in the control panel / php.ini - just guessing there..

header("Cache-Control: private, max-age=6000, pre-check=6000"); 
header("Pragma: private"); 
header("Expires: " . gmdate("D, d M Y H:i:s"). " GMT"); 

Source: click here

Author: Here

Community
  • 1
  • 1
Chris
  • 5,516
  • 1
  • 26
  • 30