That's a pretty neat idea, originally I was having to use { now|date:"u" } to put the current epoch timestamp on the end of the urls...

On 09/11/2010 10:35, Ole Laursen wrote:
Hi!

If you have the problem of visitors getting errors from using the old
Javascripts and CSS when you roll out a release, I have a sledge-
hammer solution that only requires a single-line change in your
settings.py.

It's a middleware that examines the HTML from your views and appends a
little timestamp to all URLs pointing to local files it can find. No
further setup required, although with an extra three-line
configuration to lighttpd or nginx (or whatever you're using to serve
static files), you can achieve near-perfect caching.

You can grab the middleware here, modtimeurls.py:

   http://people.iola.dk/olau/python/


I also blogged about the rationale behind here:

   http://ole-laursen.blogspot.com/2010/11/cache-busting-in-django.html

Ole


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to