9936-versioned-css-js-r10548.patch adds a query string to all CSS <link>
and JavaScript <SCRIPT>
URLs, of the form ?v={trac_version}
. The interesting part is in chrome.py
, the rest just transforms most <link>
and <script>
tags embedded in templates into the corresponding calls to add_stylesheet()
and add_script()
, respectively.
The interesting thing with using the Trac version in the query string is that:
- Users who install from a release package (source or binary) have a version
0.x.y
, and the query string change with every release.
- Users who install from SVN have a version
0.x.ydev-r1234
, and therefore the query string also changes with every update, even of a single revision.
Both Firefox and Chrome correctly cache the files, and re-get them when the version changes. Opera and IE8 display correctly, but I haven't been able to check their caching behavior. I'm pretty confident that it works correctly, though, as WordPress uses the same scheme.
Feedback and testing welcome.