Include hash in minified filenames to avoid browsers using stale files

Fixes #853.

(imported from commit f85ebe52df754f488a29c2ad814d582b78aadd14)
This commit is contained in:
Keegan McAllister 2013-02-24 13:28:43 -05:00
parent 1975d7aa16
commit d31eab9325
2 changed files with 7 additions and 2 deletions

View File

@ -189,7 +189,9 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
) )
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage' # PipelineCachedStorage inserts a file hash into filenames,
# to prevent the browser from using stale files from cache.
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATIC_ROOT = 'prod-static/collected' STATIC_ROOT = 'prod-static/collected'

View File

@ -25,4 +25,7 @@ mkdir -p prod-static/serve
rsync -ar --delete prod-static/serve-new/* prod-static/serve/ rsync -ar --delete prod-static/serve-new/* prod-static/serve/
# Clean up # Clean up
rm -rf prod-static/{collected,serve-new} rm -rf prod-static/serve-new
# Leave the 'collected' directory around or PipelineCachedStorage
# will fail.