Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache headers should be set explicitly #646

Closed
anonymous-matomo-user opened this issue Apr 9, 2009 · 2 comments
Closed

Cache headers should be set explicitly #646

anonymous-matomo-user opened this issue Apr 9, 2009 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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

@anonymous-matomo-user anonymous-matomo-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
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants