From b4e239a3a0671b1701a6f3b938f35a8550c95d2c Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 17 Jun 2025 13:26:24 +0100 Subject: [PATCH] Remove Brotli dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the Brotli dependency adds ~8MB to the app image (along with having to download/install the wheel during the build), and isn't currently used by the Getting Started guide, since it doesn't have any static assets that are compressible. ``` -rwxr-xr-x 1000:1000 7.5 MB │ ├── _brotli.cpython-313-aarch64-linux-gnu.so ``` See: https://whitenoise.readthedocs.io/en/latest/django.html#brotli-compression GUS-W-18705397. --- gettingstarted/settings.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gettingstarted/settings.py b/gettingstarted/settings.py index 55566786f..d6df80f99 100644 --- a/gettingstarted/settings.py +++ b/gettingstarted/settings.py @@ -196,7 +196,7 @@ STATIC_URL = "static/" STORAGES = { - # Enable WhiteNoise's GZip and Brotli compression of static assets: + # Enable WhiteNoise's GZip (and Brotli, if installed) compression of static assets: # https://whitenoise.readthedocs.io/en/latest/django.html#add-compression-and-caching-support "staticfiles": { "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", diff --git a/requirements.txt b/requirements.txt index 7ce9e89f3..f8c3df4f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ django>=5.2,<5.3 gunicorn>=23,<24 dj-database-url>=2,<3 -whitenoise[brotli]>=6,<7 +whitenoise>=6,<7 # Uncomment these lines to use a Postgres database. Both are needed, since in production # (which uses Linux) we want to install from source, so that security updates from the