From 4848e689cf42a367f352be62c011a588a3a46248 Mon Sep 17 00:00:00 2001 From: Schemen Date: Tue, 25 Jul 2023 12:05:06 +0200 Subject: [PATCH 1/2] Add cache busting --- dndtools/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dndtools/settings.py b/dndtools/settings.py index 33ef93f..cc8305b 100644 --- a/dndtools/settings.py +++ b/dndtools/settings.py @@ -159,8 +159,8 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.0/howto/static-files/ +STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' STATIC_URL = '/static/' - STATIC_ROOT = os.path.join(BASE_DIR, 'static') AUTH_USER_MODEL = 'paperminis.User' @@ -189,4 +189,4 @@ messages.SUCCESS: 'alert-success', messages.WARNING: 'alert-warning', messages.ERROR: 'alert-danger', - } \ No newline at end of file + } From 7b0798b514387c91253951ca288044773f51615c Mon Sep 17 00:00:00 2001 From: Schemen Date: Tue, 25 Jul 2023 12:15:24 +0200 Subject: [PATCH 2/2] Update config file, version, and prep release --- CHANGELOG.md | 6 ++++++ nginx/djangonginx.conf | 21 +++++++++++++++++++-- paperminis/__init__.py | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f4c4bd..c56ab8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.11.0(2023-07-25) + +### Improvement +* Implement Caching and Cache Busting + + ## 1.10.1(2023-07-19) ### Updates diff --git a/nginx/djangonginx.conf b/nginx/djangonginx.conf index 589c9af..04b0223 100644 --- a/nginx/djangonginx.conf +++ b/nginx/djangonginx.conf @@ -1,14 +1,31 @@ server { listen 80; server_name localhost; + real_ip_header X-real-IP; + + # compression + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; # serve static files location /static/ { + sendfile on; + expires max; # change this to a value that suits your needs + add_header Cache-Control "public"; alias /static/; } # pass requests for dynamic content to gunicorn location / { - proxy_pass http://app:8080; + proxy_pass http://monsterforge:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -} +} \ No newline at end of file diff --git a/paperminis/__init__.py b/paperminis/__init__.py index 884beed..ae10819 100644 --- a/paperminis/__init__.py +++ b/paperminis/__init__.py @@ -1,2 +1,2 @@ -__version__ = '1.10.1' +__version__ = '1.11.0' VERSION = __version__ # synonym