Skip to content

Commit

Permalink
Merge pull request #55 from skieffer/force-revalidate
Browse files Browse the repository at this point in the history
m: Use "force revalidation" pattern for twin site conf
  • Loading branch information
skieffer authored Jan 13, 2024
2 parents e0295f8 + c11bcf4 commit f70c14a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions manage/topics/nginx/templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ server {
listen {{listen_on}}{{' ssl' if ssl else ''}};
server_name {{twin_server_name}};

# We use the "force revalidation" pattern
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#force_revalidation
# so that readers always get the latest version of each page.
# Nginx already serves `ETag` and `Last-Modified` headers by default, so we
# just need to add the `Cache-Control: no-cache` header.
add_header Cache-Control "no-cache";

{% if ssl %}
{% if hsts_seconds %}add_header Strict-Transport-Security "max-age={{hsts_seconds}};" always;{% endif %}
ssl_certificate /etc/nginx/ssl/cert;
Expand Down

0 comments on commit f70c14a

Please sign in to comment.