]> git.ipfire.org Git - thirdparty/patchwork.git/commit
settings: Help caching with content-aware static file names
authorDamien Lespiau <damien.lespiau@intel.com>
Thu, 4 Feb 2016 13:56:51 +0000 (13:56 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Fri, 1 Apr 2016 12:19:32 +0000 (13:19 +0100)
commit282285406c3aa9dec8d03b98ff169b5ada5eb47a
tree89c5b101dc1a88ab787ef2600a850a9d7074caa5
parentc87110906bbc99ebcff5a43992e08d7a3d9e1d1d
settings: Help caching with content-aware static file names

If we always serve the "style.css" file, even when its content changes,
we run into the situation where the browser (or any HTTP aware middle
man) will cache the file and not download a newer version.

This can be solved by appending the file hash to its filename. If the
content changes, the file name changes and the new version is used right
away. We can also use far future Expires headers with such static files,
they will really never change.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
v2: Disable for Django < 1.7
patchwork/settings/production.example.py