My index.php page keeps being cached, showing old timer values and others, even though I'm using this:
session_cache_limiter( 'nocache' );
session_start( );
header( 'Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0' );
to keep the browser from caching the page. I've checked the headers output in Firefly and they keep saying:
Cache-Control:private, max-age=10800, pre-check=10800
I used to have this in the HTML META:
<META HTTP-EQUIV="cache-control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
But have already disabled those in order to check if they were interfering, but enabled or disabled doesn't make a difference.
All help is appreciated!
Headers output in FireFly is still Cache-Control private, max-age=10800, pre-check=10800, no-cache, must-revalidate, post-check=0, pre-check=0
This implies that since you are setting this:
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Some other component/configuration in your app/page is setting this:
Cache-Control: private, max-age=10800, pre-check=10800
and both are sent to the end user. The "Cache-Control: private" overrides your values when browser reads them, causing the page to be cached.
Note: header() will by default override any headers that are previously set, so it might be that something is setting that after your line of code, since your line should override any previous ones.
You need to find out what is setting those "private" cache-control headers and disable/comment that, otherwise it will not work. Maybe some other section later in your code?
Set the cache expiration date to an old date.
header( 'Expires: Fri, 01 Jan 2010 00:00:00 GMT' );