I have a Piwik install sitting behind a varnish-caching server. My problem is varnish is by default caching responses to my API calls. Unfortunately, I don’t have direct access to the varnish server, so I need to send the
"Cache-Control: no-cache"
header with my API responses. Is there a setting or a way to modify my piwik install to accomplish this? Thanks!
Add to
.htaccessin your piwik install,core/API/folder:If you need to add the header to other URLs, follow the same pattern.
Note that Piwik already adds
Cache-Control: max-age=0to these responses, so if that’s not working for you on the Request.php path you probably want to add this to .htaccess in the folder withpiwik.js(root of piwik install) as well: