From 69f6ff9171d72e8bebf16f8e2af48bc77ce8285d Mon Sep 17 00:00:00 2001 From: Mike Rogers Date: Wed, 24 Feb 2021 15:12:48 +0000 Subject: [PATCH 1/2] Adding expiry headers --- config/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/nginx.conf b/config/nginx.conf index 82ad28b..8e3867f 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,3 +1,12 @@ +# Expires map +map $sent_http_content_type $expires { + default off; + text/html 24h; + text/css max; + application/javascript max; + ~image/ max; +} + # # --- Stable docs -------------------------------------------------------------- # @@ -5,6 +14,7 @@ server { server_name api.rubyonrails.org; gzip_static on; + expires $expires; location ~ ^/v\d { root /home/rails/api; @@ -38,6 +48,7 @@ server { server { server_name guides.rubyonrails.org; gzip_static on; + expires $expires; rewrite /contributing_to_rails.html /contributing_to_ruby_on_rails.html permanent; rewrite /contribute.html /contributing_to_ruby_on_rails.html permanent; @@ -79,6 +90,7 @@ server { server { server_name edgeapi.rubyonrails.org; gzip_static on; + expires $expires; root /home/rails/api/edge; index index.html; @@ -95,6 +107,7 @@ server { server { server_name edgeguides.rubyonrails.org; gzip_static on; + expires $expires; rewrite /contributing_to_rails.html /contributing_to_ruby_on_rails.html permanent; rewrite /contribute.html /contributing_to_ruby_on_rails.html permanent; From 0ffee45f2ba78a6fb6f68497ee1c311a3faa2372 Mon Sep 17 00:00:00 2001 From: Mike Rogers Date: Wed, 24 Feb 2021 17:34:00 +0000 Subject: [PATCH 2/2] Removing caching headers for HTML/CSS/JS --- config/nginx.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index 8e3867f..de27801 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,9 +1,6 @@ # Expires map map $sent_http_content_type $expires { default off; - text/html 24h; - text/css max; - application/javascript max; ~image/ max; }