Move gzipping to nginx

This means less time is spent in gunicorn, letting the workers process other requests sooner.
This commit is contained in:
Jake Howard 2024-05-04 23:19:43 +01:00
parent 514e609973
commit 7fcbbad885
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,9 @@ server {
gzip_static on;
gzip on;
gzip_vary on;
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
@ -39,6 +42,7 @@ server {
location / {
proxy_pass http://localhost:8080;
gzip_types *;
}
location /static {

View File

@ -94,7 +94,6 @@ INSTALLED_APPS = [
]
MIDDLEWARE = [
"django.middleware.gzip.GZipMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"corsheaders.middleware.CorsMiddleware",