From 64fbc735829e405e676a03603f9fa0818cdf22f8 Mon Sep 17 00:00:00 2001 From: Alireza Date: Fri, 2 Feb 2018 17:42:19 +0330 Subject: [PATCH 1/3] Added expires directive and map to nginx, allowing browser to cache rspamd JS,CSS and image files. --- data/conf/nginx/site.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 8a896264..cf81c0b0 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -7,6 +7,13 @@ map $http_x_forwarded_proto $client_req_scheme { https https; } +map $sent_http_content_type $expires { + default off; + text/css 1d; + application/javascript 1d; + ~image/ 1d; +} + server { listen 80 default_server; listen [::]:80 default_server; @@ -81,6 +88,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; + expires $expires; } location ~* ^/Autodiscover/Autodiscover.xml { @@ -263,6 +271,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; + expires $expires; } location ~* ^/Autodiscover/Autodiscover.xml { From 1b898b1c7b6edb564a5980e3d22e11ffbf7370c2 Mon Sep 17 00:00:00 2001 From: Alireza Date: Fri, 2 Feb 2018 17:46:49 +0330 Subject: [PATCH 2/3] Added expires directive and map to nginx, allowing browser to cache rspamd JS,CSS and image files. --- data/conf/nginx/site.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index cf81c0b0..25516fda 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -9,9 +9,11 @@ map $http_x_forwarded_proto $client_req_scheme { map $sent_http_content_type $expires { default off; + text/html off; text/css 1d; application/javascript 1d; - ~image/ 1d; + application/json off; + image/png 1d; } server { From 781a5eb69aa650414e2d125e7696173c38137c4e Mon Sep 17 00:00:00 2001 From: Alireza Date: Fri, 2 Feb 2018 18:38:18 +0330 Subject: [PATCH 3/3] Added expires directive and map to nginx, allowing browser to cache SOGO JS,CSS,WOFF files. --- data/conf/nginx/site.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 25516fda..72f8a5af 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -161,6 +161,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -171,6 +172,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -344,6 +346,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; } @@ -354,6 +357,7 @@ server { proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/WebServerResources/; + expires $expires; allow all; }