From 922a982f09f90a022996cddc2af87fea2d59d78d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 10 May 2020 15:12:27 +0100 Subject: [PATCH] Brotli and gzip encode responses --- requirements.txt | 1 + website/settings.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 7a8e7a3..c743b12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ brotli==1.0.7 django-environ==0.4.5 gunicorn ==20.0.4 django-sri==0.2.0 +django-brotli==0.2.0 diff --git a/website/settings.py b/website/settings.py index 0e2241d..2671c16 100644 --- a/website/settings.py +++ b/website/settings.py @@ -46,6 +46,8 @@ INSTALLED_APPS = [ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", + "django_brotli.middleware.BrotliMiddleware", + "django.middleware.gzip.GZipMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware",