Project

General

Profile

User story #4519

Add caching information to static JS/CSS resources

Added by François ARMAND over 3 years ago. Updated 6 months ago.

Status:
Released
Priority:
2
Category:
Performance and scalability
Target version:
Target version (plugin):
Suggestion strength:
User visibility:
Effort required:

Description

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


Related issues

Related to Rudder - Bug #4591: Several issues with new display of Rules Rejected 2014-03-11
Related to Rudder - User story #10366: Add expiration on static resources Rejected
Related to Rudder - Bug #10365: Enable gzip compression on text resources Released
Related to Rudder - Bug #10387: Rudder (svg) logo aren't displayed with chrome Released

Associated revisions

Revision 990c13c1
Added by François ARMAND 7 months ago

Fixes #4519: Make static JS/CSS resources load faster

History

#2 Updated by François ARMAND over 3 years ago

Thanks, actually that was one of our reference ;)

#3 Updated by François ARMAND over 3 years ago

  • Assignee set to Vincent MEMBRÉ

Along with the minification of CSS and to be able to cache them effectively, we need to versionned them to avoid things like: #4591

#4 Updated by François ARMAND over 3 years ago

  • Description updated (diff)

#5 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.0~beta1 to 2.10.0

#6 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.0 to 2.11.0~beta1

#7 Updated by Jonathan CLARKE over 3 years ago

  • Target version changed from 2.11.0~beta1 to 140

#8 Updated by Matthieu CERDA almost 3 years ago

  • Target version changed from 140 to 3.0.0~beta1

#9 Updated by Jonathan CLARKE almost 3 years ago

  • Target version changed from 3.0.0~beta1 to 3.1.0~beta1

#10 Updated by Benoît PECCATTE over 2 years ago

  • Status changed from 8 to New

#11 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.0~beta1 to 3.1.0~rc1

#12 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.0~rc1 to 3.1.0

#13 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.0 to 3.1.1

#14 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.1 to 3.1.2

#15 Updated by Jonathan CLARKE about 2 years ago

  • Target version changed from 3.1.2 to Ideas (not version specific)

#16 Updated by Nicolas CHARLES over 1 year ago

We could add the version number in the js file, by takeing the version defined in the pom.xml
ref: http://stackoverflow.com/questions/3697449/retrieve-version-from-maven-pom-xml-in-code
ref: https://blog.akquinet.de/2011/02/11/mavenizing-javascript-projects/

#17 Updated by François ARMAND over 1 year 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 ?

#18 Updated by François ARMAND 7 months ago

#19 Updated by François ARMAND 7 months ago

  • Related to Bug #10365: Enable gzip compression on text resources added

#20 Updated by François ARMAND 7 months ago

  • Target version changed from Ideas (not version specific) to 4.1.0

#21 Updated by François ARMAND 7 months ago

  • Status changed from New to In progress
  • Assignee changed from Vincent MEMBRÉ to François ARMAND

#22 Updated by François ARMAND 7 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/1568

#23 Updated by François ARMAND 7 months ago

  • Status changed from Pending technical review to Pending release

#24 Updated by François ARMAND 7 months ago

  • Related to Bug #10387: Rudder (svg) logo aren't displayed with chrome added

#25 Updated by Alexis MOUSSET 6 months ago

  • Subject changed from Make static JS/CSS resources load faster to Add caching information to static JS/CSS resources

#26 Updated by Benoît PECCATTE 6 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.0 which was released today.

Also available in: Atom PDF