From 8f52fa482abfe940b6f07ce13e6451d0fe659aef Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:12:00 +0100 Subject: [PATCH] Added optional cache-control header to static config --- content/collections/docs/static-caching.md | 2 ++ content/collections/docs/ubuntu.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/content/collections/docs/static-caching.md b/content/collections/docs/static-caching.md index e364f920b..cd10b0dc8 100644 --- a/content/collections/docs/static-caching.md +++ b/content/collections/docs/static-caching.md @@ -160,6 +160,8 @@ location / { } location @static { + # Allow the browser (and a proxy) to cache static pages, Laravel wil overwrite it with "no-cache, private" by default if index.php needs to be hit. + # add_header Cache-Control "max-age=120, stale-while-revalidate=3600"; try_files /static${uri}_$args.html $uri $uri/ /index.php?$args; } diff --git a/content/collections/docs/ubuntu.md b/content/collections/docs/ubuntu.md index 6d672d259..885ba4aa1 100644 --- a/content/collections/docs/ubuntu.md +++ b/content/collections/docs/ubuntu.md @@ -148,6 +148,8 @@ server { } location @static { + # Allow the browser (and a proxy) to cache static pages, Laravel wil overwrite it with "no-cache, private" by default if index.php needs to be hit. + # add_header Cache-Control "max-age=120, stale-while-revalidate=3600"; try_files /static${uri}_$args.html $uri $uri/ /index.php?$args; }