mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Set far-future cache headers on S3 assets
So that browsers will cache them for as long as possible. We invalidate
this cache by adding the hash of each file to the query string.
There’s no way of doing this on a whole bucket; it has to be set on each
item. Adding this flag does so at the time of uploading the items.
Value of 10 years in seconds taken from:
0ee3bcb1ee/whitenoise/base.py (L19)
This commit is contained in:
2
Makefile
2
Makefile
@@ -99,7 +99,7 @@ upload-paas-artifact:
|
||||
|
||||
.PHONY: upload-static ## Upload the static files to be served from S3
|
||||
upload-static:
|
||||
aws s3 cp --region eu-west-1 --recursive ./app/static s3://${DNS_NAME}-static
|
||||
aws s3 cp --region eu-west-1 --recursive --cache-control max-age=315360000,immutable ./app/static s3://${DNS_NAME}-static
|
||||
|
||||
.PHONY: test
|
||||
test: venv ## Run tests
|
||||
|
||||
Reference in New Issue
Block a user