Skip to content

Commit

Permalink
Merge branch 'lukeburden-brotli-cloudfront-docs' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
evansd committed Jul 29, 2020
2 parents a7b3ffc + 89b7c82 commit a4a445a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/django.rst
Expand Up @@ -170,6 +170,21 @@ For apps on Heroku, you'd run this command
heroku config:set DJANGO_STATIC_HOST=https://d4663kmspf1sqa.cloudfront.net
Using compression algorithms other than gzip
++++++++++++++++++++++++++++++++++++++++++++

By default, CloudFront will discard any ``Accept-Encoding`` header browsers include
in requests, unless the value of the header is gzip. If it is gzip, CloudFront will
fetch the uncompressed file from the origin, compress it, and return it to the
requesting browser.

To get CloudFront to not do the compression itself as well as serve files compressed
using other algorithms, such as Brotli, you must configure your distribution to
`cache based on the Accept-Encoding header`__. You can do this in the ``Behaviours``
tab of your distribution.

.. __: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-custom-origin

.. note::

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

0 comments on commit a4a445a

Please sign in to comment.