Skip to content

Commit

Permalink
patches: Backport compressor content based compression
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jul 7, 2023
1 parent 3424f68 commit ec90869
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 90fbea8a41019ccd992f44f87c8268d42494823a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <[email protected]>
Date: Thu, 29 Jun 2023 19:58:03 +0200
Subject: [PATCH 1/1] settings: Use content hashing for django-compressor

This makes it safe to deploy on multiple servers.

See https://github.com/WeblateOrg/helm/issues/54
---
weblate/settings_docker.py | 1 +
weblate/settings_example.py | 1 +
2 files changed, 2 insertions(+)

diff --git weblate/settings_docker.py weblate/settings_docker.py
index 07c379ad4c..e7856b5c69 100644
--- weblate/settings_docker.py
+++ weblate/settings_docker.py
@@ -1229,6 +1229,7 @@ FONTS_CDN_URL = None
# Django compressor offline mode
COMPRESS_OFFLINE = True
COMPRESS_OFFLINE_CONTEXT = "weblate.utils.compress.offline_context"
+COMPRESS_CSS_HASHING_METHOD = "content"

# Require login for all URLs
if REQUIRE_LOGIN:
diff --git weblate/settings_example.py weblate/settings_example.py
index 55127b0c30..ddda288a50 100644
--- weblate/settings_example.py
+++ weblate/settings_example.py
@@ -873,6 +873,7 @@ FONTS_CDN_URL = None
# Django compressor offline mode
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_CONTEXT = "weblate.utils.compress.offline_context"
+COMPRESS_CSS_HASHING_METHOD = "content"

# Require login for all URLs
if REQUIRE_LOGIN:
--
2.32.0

0 comments on commit ec90869

Please sign in to comment.