Static css and js files should user a version in the url to ensure that clients get the latest version

Bug #1092167 reported by Janos Gyerik
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Web Gallery
Fix Released
High
Robin Gloster
Ubuntu Community Web Themes
In Progress
Undecided
Robin Gloster

Bug Description

It is a problem that the pages load css files without a version in the url, for example:

    {{ STATIC_URL }}css/style.css

If would be better to include a version id in the url that changes every time we commit an update to the file, for example:

    {{ STATIC_URL }}css/style.css?v=234

I don't know what is a good way to manage this. In the worst case we can manually increment the version number when making a change. Or a simple automated way could be getting the bzr revno somehow and passing it to the django template. Or we can use something more advanced like this django module:
http://www.allbuttonspressed.com/projects/django-mediagenerator

For the time being, I think it's ok to use hardcoded ?v=234 postfixes which we have to manually increment on every css change. Feel free to suggest a better way, especially something that you are using yourself in other projects.

Related branches

Changed in ubuntu-accomplishments-web:
milestone: none → 0.4
Changed in ubuntu-accomplishments-web:
assignee: nobody → Robin Gloster (robin-gloster)
status: Confirmed → Fix Committed
Revision history for this message
Janos Gyerik (janos-gyerik) wrote :

Nice nice, thanks Robin!

Changed in ubuntu-accomplishments-web:
status: Fix Committed → Fix Released
Changed in ubuntu-community-webthemes:
assignee: nobody → Robin Gloster (robin-gloster)
status: New → Fix Committed
Revision history for this message
Chris Johnston (cjohnston) wrote :

This doesn't seem to be merged into light-django-theme yet.

Changed in ubuntu-community-webthemes:
status: Fix Committed → In Progress
Revision history for this message
Janos Gyerik (janos-gyerik) wrote :

As far as the Ubuntu Accomplishments project is concerned, this has been committed.
After it has been merged into light-django-theme we would change it to Fix Released.

Chris, does it affect you in any way if this is marked Fix Committed? For us it makes more sense that way.

Revision history for this message
Chris Johnston (cjohnston) wrote :

The merge proposal is into lp:ubuntu-community-webthemes/light-django-theme - until it has been merged into that branch (and pushed up into LP) it is not fix committed. If you merge it into that branch on your local system (meaning anything other than LP), it isn't fix committed.

Revision history for this message
Robin Gloster (robin-gloster) wrote :

Sorry my bad, got the launchpad terminology wrong.

Revision history for this message
Janos Gyerik (janos-gyerik) wrote :

I did not know that a bug can be listed at two places:
https://bugs.launchpad.net/ubuntu-accomplishments-web/+bug/1092167
https://bugs.launchpad.net/ubuntu-community-webthemes/+bug/1092167

I was aware of the first one only, I had no idea that this shows up in your project Chris.

Revision history for this message
Chris Johnston (cjohnston) wrote :

Not a problem guys. Just trying to keep things straight so that it does get added at some point (hopefully soon)

Revision history for this message
Robin Gloster (robin-gloster) wrote :

Is there still a problem with my merge request?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.