Skip to content

Commit a4a445a

Browse files
committed
Merge branch 'lukeburden-brotli-cloudfront-docs' into master
2 parents a7b3ffc + 89b7c82 commit a4a445a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/django.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,21 @@ For apps on Heroku, you'd run this command
170170
heroku config:set DJANGO_STATIC_HOST=https://d4663kmspf1sqa.cloudfront.net
171171
172172
173+
Using compression algorithms other than gzip
174+
++++++++++++++++++++++++++++++++++++++++++++
175+
176+
By default, CloudFront will discard any ``Accept-Encoding`` header browsers include
177+
in requests, unless the value of the header is gzip. If it is gzip, CloudFront will
178+
fetch the uncompressed file from the origin, compress it, and return it to the
179+
requesting browser.
180+
181+
To get CloudFront to not do the compression itself as well as serve files compressed
182+
using other algorithms, such as Brotli, you must configure your distribution to
183+
`cache based on the Accept-Encoding header`__. You can do this in the ``Behaviours``
184+
tab of your distribution.
185+
186+
.. __: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-custom-origin
187+
173188
.. note::
174189

175190
By default your entire site will be accessible via the CloudFront URL. It's

0 commit comments

Comments
 (0)