From 09a580f346587ba014364c5048c0cc5d677401ec Mon Sep 17 00:00:00 2001 From: jonas-grobe <143589622+jonas-grobe@users.noreply.github.com> Date: Thu, 4 Jan 2024 17:17:43 +0100 Subject: [PATCH] Readme.htaccess - only serve GET from cache By default, only GET requests are cached, so these are the only ones which should be served from cache. Also fixes #37 --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index f1c2de3..8b4e2d0 100644 --- a/readme.md +++ b/readme.md @@ -101,13 +101,17 @@ In order to serve the static files directly once they've been cached, you need t ```apacheconf # Serve Cached Page If Available... + RewriteCond %{REQUEST_METHOD} =GET RewriteCond %{REQUEST_URI} ^/?$ RewriteCond %{DOCUMENT_ROOT}/page-cache/pc__index__pc.html -f RewriteRule .? page-cache/pc__index__pc.html [L] + RewriteCond %{REQUEST_METHOD} =GET RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}.html -f RewriteRule . page-cache%{REQUEST_URI}.html [L] + RewriteCond %{REQUEST_METHOD} =GET RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}.json -f RewriteRule . page-cache%{REQUEST_URI}.json [L] + RewriteCond %{REQUEST_METHOD} =GET RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}.xml -f RewriteRule . page-cache%{REQUEST_URI}.xml [L] ```