From: M. Taylor Saotome-Westlake Date: Mon, 23 Sep 2019 02:03:22 +0000 (-0700) Subject: tech: don't cache HTML X-Git-Url: http://unremediatedgender.space/source?p=Ultimately_Untrue_Thought.git;a=commitdiff_plain;h=6ad37f8d749e521c49e0a5f194a0912bc3593d34 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. --- 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; } }