User story #4519
Add caching information to static JS/CSS resources
We don't use any best practice about our CSS/JS file regarding performance: no minising, compactation, Apache cache, or other standard technique.
List what is needed in children ticket and do it.
Among the other things, we will need to take care of CSS and JS versionning so that caching works as expected (i.e: browser don't serve cache information when it should reload them).
Updated by Nicolas CHARLES about 3 years ago
We could add the version number in the js file, by takeing the version defined in the pom.xml
Updated by François ARMAND about 3 years ago
Some more information:
- if we use something maven-related, we will need to translate it for each non-maven project with CSS/Js. For now, at least ncf, but perhaps other in the future ;
- we already have a "post process" done on release, that change the Rudder version displayed in the footer by the actual version. We can not reuse it as it is implemented, because it uses a very specific and non portable (and hacky) regex to change it.
All in all, I think we should:
- impose the best practice to add version in parameter of js/css resources, whatever the mean to reach that goal actually used;
- let each project with js/css resources manage the way the version change and is versionned, because it is the best to know if cache should be invalidated or not (typically, I suspect that there is case where we don't need/want to change it on some minor version of Rudder, and we almost always want to change it when coding css/js)
What do you thing ?