Skip to content

Commit

Permalink
settings: Help caching with content-aware static file names
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Damien Lespiau committed Feb 4, 2016
1 parent e026cc7 commit 6bc5dd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion patchwork/settings/production.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
#
# Static files settings
# https://docs.djangoproject.com/en/1.7/ref/settings/#static-files
# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage
#

STATIC_ROOT = '/srv/patchwork/htdocs/static'

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

0 comments on commit 6bc5dd2

Please sign in to comment.