only caching GET requests for static files

closes #1
main
Rudis Muiznieks 4 weeks ago
parent 8f04f74800
commit 16cd4d52c5
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
  1. 6
      server.pl

@ -212,7 +212,11 @@ my $enable_experimental_features = $ENV{'ENABLE_EXPERIMENTAL_FEATURES' } || 0;
if (!serve_static($server, $cgi, $webroot)) {
$cached = 0;
}
$_staticcache->set($path, $cached);
# only save to cache on GET requests
# https://code.sitosis.com/rudism/dotplan-online/issues/1
if ($cgi->request_method() eq 'GET') {
$_staticcache->set($path, $cached);
}
}
print $cached if $cached;
return $cached;

Loading…
Cancel
Save