"Vary" cool new features

Posted by Adrian Holovaty on Oct. 11, 2005

Thanks to contributions from Sune Kirkeby and Hugo, Django's cache and middleware systems got some huge improvements over the weekend.

Django-served pages are now, by default, cache-friendly. That is, they output Vary HTTP headers behind the scenes, to instruct caching servers (such as Squid or other proxies) when to cache and what to cache by.

You, the Web-app writer, have fine-grained control over which Vary headers are sent out for a particular view. Check out our new "Controlling cache" documentation for the full scoop.

Also, we've added two performance-enhancing middleware modules: support for conditional GET and gzipping output. They were part of the cache middleware before, but we've split them to give people more flexibility; now you can, for instance, activate conditional GET but not gzip, or vice versa. See the middleware documentation.

Back to Top