From 6ad37f8d749e521c49e0a5f194a0912bc3593d34 Mon Sep 17 00:00:00 2001 From: "M. Taylor Saotome-Westlake" Date: Sun, 22 Sep 2019 19:03:22 -0700 Subject: [PATCH] tech: don't cache HTML Thanks to https://www.digitalocean.com/community/tutorials/ how-to-implement-browser-caching-with-nginx-s-header-module-on-centos-7 for teaching. --- notes/tech_tasks.txt | 1 - provisioning/nginx_siteconf | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/notes/tech_tasks.txt b/notes/tech_tasks.txt index bac30d2..b35253b 100644 --- a/notes/tech_tasks.txt +++ b/notes/tech_tasks.txt @@ -5,7 +5,6 @@ put (partial?) post slug back in footnotes (needed to disambiguate on multi-post bigger click-target pagination links verify my domain with Search Console so that I can see search keywords restrict "fiction" to "longform" (not dialogues) (I made the opposite call at some point, and I think I want to reverse it) -What's going on with caching behavior?? 404 page?? glitchiness in "Editorial Process" link to archives page diff --git a/provisioning/nginx_siteconf b/provisioning/nginx_siteconf index 2f2cd07..8db2fce 100644 --- a/provisioning/nginx_siteconf +++ b/provisioning/nginx_siteconf @@ -1,3 +1,8 @@ +map $sent_http_content_type $expires { + default off; + text/html epoch; +} + server { listen 80 default_server; listen [::]:80 default_server; @@ -8,6 +13,8 @@ server { server_name _; + expires $expires; + location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. @@ -30,7 +37,7 @@ server { location /static { # gitweb static files root /usr/share/gitweb; - try_files $uri $uri/ =404; + try_files $uri $uri/ =404; } } -- 2.17.1