Cache headers should be set explicitly #646

Closed
anonymous-piwik-user opened this Issue Apr 9, 2009 · 2 comments

2 participants

@anonymous-piwik-user

One thing that would be important to ensure accurate numbers is making sure the tracking image isn’t cached. We should send back the following headers:

Cache-Control: private, no-cache, proxy-revalidate
Pragma: no-cache

So in core/Tracker.php, maybe do something like:

protected function outputTransparentGif()
{
if( !isset($GLOBALS[|| !$GLOBALS[‘DEBUGPIWIK’](‘DEBUGPIWIK’])) )
{
$trans_gif_64 = “R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==”;
header(“Content-type: image/gif”);
header(‘Pragma: no-cache’);
header(‘Cache-Control: private, no-cache, proxy-revalidate’);
print(base64_decode($trans_gif_64));
}
}

@robocoder

PHP ships with the default headers to not cache.

I agree we should probably set these headers explicitly (instead of assuming the default php configuration).

@robocoder

(In [1071]) Fixes #646, setting cache headers explicitly to nocache instead of
assuming PHP default.

@anonymous-piwik-user anonymous-piwik-user added this to the Piwik 0.6.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment