Skip to content

Commit b95786f

Browse files
committed
Don’t serve static responses for POST, PUT…
Fixes #32
1 parent 2c00885 commit b95786f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ To load the static cache files from PHP, please place the following code snippet
220220
(function /* staticache */ () {
221221
$root = __DIR__ . '/site/cache';
222222

223+
// only use cached files for static responses, pass dynamic requests through
224+
if (in_array($_SERVER['REQUEST_METHOD'], ['GET', 'HEAD']) === false) {
225+
return;
226+
}
227+
223228
// check if a cache for this domain exists
224229
$root .= '/' . $_SERVER['SERVER_NAME'] . '/pages';
225230
if (is_dir($root) !== true) {

0 commit comments

Comments
 (0)