Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cache headers should be set explicitly #646

Closed
anonymous-piwik-user opened this Issue · 2 comments

2 participants

Anonymous Piwik user Anthon Pang
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)); } }

Anthon Pang
Collaborator

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).

Anthon Pang
Collaborator

(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
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.