Skip to content

Commit

Permalink
Merge pull request #1923 from laws-africa/lawlibrary-files
Browse files Browse the repository at this point in the history
Serve lawlibrary files from CDN
  • Loading branch information
longhotsummer authored Jul 19, 2024
2 parents 14d2583 + a3ddb3d commit 85131a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lawlibrary/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@
TEMPLATES[0]["OPTIONS"]["context_processors"].append( # noqa
"lawlibrary.context_processors.lawlibrary"
)


if not DEBUG: # noqa
# Law Library media files are stored on S3 and served via a Cloudflare CDN (via copying to R2).
# We can therefore set long-lived cache headers and serve them from a custom domain.
AWS_S3_OBJECT_PARAMETERS = {"CacheControl": f"max-age={86400*5}"}
AWS_S3_CUSTOM_DOMAIN = "media.lawlibrary.org.za"

0 comments on commit 85131a1

Please sign in to comment.