matomo-org / matomo-nginx

Nginx configuration for running Matomo
406 stars 121 forks source link

Do not cache tag manager preview files #48

Closed tsteur closed 5 years ago

tsteur commented 5 years ago

To make sure always the newest version of a preview container in tag manager is served, we should prevent the caching in the browser. For the apache version see https://github.com/matomo-org/matomo/pull/13977 Header set Cache-Control "Cache-Control: private, no-cache, no-store" for ^js/container_.*_preview\.js$

Otherwise the user will need to use ctrl+r or something to reload a page that includes a preview file to make sure the cache is ignored and many users would not know that.

Findus23 commented 5 years ago

Done:

curl -v https://matomo.example/js/container_PlwIwwkk_preview.js
.....
< HTTP/2 200 
< server: nginx
< date: Sat, 15 Jun 2019 13:56:30 GMT
< content-type: application/javascript
< content-length: 0
< last-modified: Sat, 15 Jun 2019 13:55:23 GMT
< etag: "5d04f8cb-0"
< cache-control: private, no-cache, no-store
< accept-ranges: bytes