|
We originally got inspired by the GWT approach of using a .timestamp.cache. pattern. But this has the following disadvantages:
- the filename changes: if one loads js script dynamically one has no clue what the correct pattern would be
- relative CSS resources (for instance background images) are not having a cache friendly filename
Solutions:
A) process the css file and add the timestamp dynamically if needed
+ doable as the files can be freemarker templates (processed CSS)
- how to know the correct modification date? in case the files are in the DMS?
- can be very complex
B) use a path prefix: /cache/timestamp/
+ filename doesn't change
+ relative resources are also cached
- only works for files which share the parent path (relative urls)
- the timestamp is shared. if one changes an image one has to touch the CSS file to change its modification date
|