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
Updating to a new Piwik version should automatically force the browser to update the cache for JS/CSS files #712
Comments
Use a rewrite rule. E.g.:
... as you said, this fixes the issues for all users. However, this also prevents browsers from caching the .js file ever. Pushing it through a PHP script doesn't really do any good either. Point taken, it may fix issues in the short run, in the long run, you need PHP to execute static files. What you want is something like this: A matching rewrite rule:
This makes sure that if the file (or directory) exists, no redirect is done. And it'll only catch |
For nginx, I think this should do:
(No guarantees, though. Haven't had a chance to try it. |
another easy thing to do, reload all .js with a global include no guarantee too.. i begin in php ;) |
CTRL+F5 works well too ;) "Welcome to the new version of piwik, to be sure to have latest widget enhancements, please refresh your browser thanks to CTRL+F5" very efficient method ;) |
Thanks for all the suggestions. We will use something in the URL as a cache buster. The url rewriting rules are web server specific. I try to avoid .htaccess files (because of the performance hit), but not everyone has access to their httpd.conf. |
the browser will correctly cache $NAME.js?version=$VERSION so both propositions in the ticket are valid and efficient (cache would just be refreshed at each update which is the desired effect). |
If in doubt you could always make a performance wiki page that tells people the pros and cons of I think this would be most def. better than piping it through a PHP script. I guess the question is if the piwik frontend needs to make use of caching per se. After all, the intense part is the collection and the crunching. |
what are the issues of "piping" it through a php script considering it's cached and should only be executed once? also, .htaccess is not a solution as it's server dependant and this sort of functionnality should be handled at the application level. |
(In [1152]) quick fixes #712 - add Smarty output filter to add cache busting string |
This issue has always existed in Piwik, after each upgrade where some JS or CSS were updated, some users would experience issues as their browser would still use the old cached JS or CSS and this would break some bits of Piwik. This became a more important issue with 0.2.35 where a lot of the JS files were updated and broke the dashboard for most users; to fix it they had to find out the issue (eg. looking at the forum) and delete their browser cache, which is not a good user experience.
There are several ways we could fix this:
If anybody wants to help please shout! This feature is def a good one for a developer new to the project.
The text was updated successfully, but these errors were encountered: