aboutsummaryrefslogtreecommitdiffstats
path: root/lib/WWW/FairViewer.pm
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-11-04 02:12:53 +0200
committerJesús <heckyel@hyperbola.info>2020-11-09 17:41:53 -0500
commitc624698bdb859e1ac1f86659b92e0fd802be0f51 (patch)
tree1b2a27503c7daf05b4b16f9ee642444cdf3b4a78 /lib/WWW/FairViewer.pm
parent60afbd4f5bc06fdc62cb71df61439a212f698c2b (diff)
downloadfair-viewer-c624698bdb859e1ac1f86659b92e0fd802be0f51.tar.lz
fair-viewer-c624698bdb859e1ac1f86659b92e0fd802be0f51.tar.xz
fair-viewer-c624698bdb859e1ac1f86659b92e0fd802be0f51.zip
Don't cache if "cache-control" says "no-cache".
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib/WWW/FairViewer.pm')
-rw-r--r--lib/WWW/FairViewer.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm
index e8c363e..75f8fb0 100644
--- a/lib/WWW/FairViewer.pm
+++ b/lib/WWW/FairViewer.pm
@@ -277,8 +277,8 @@ sub set_lwp_useragent {
$code >= 300 # do not cache any bad response
or $response->request->method ne 'GET' # cache only GET requests
- # don't cache if "cache-control" specifies "max-age=0" or "no-store"
- or (($response->header('cache-control') // '') =~ /\b(?:max-age=0|no-store)\b/)
+ # don't cache if "cache-control" specifies "max-age=0", "no-store" or "no-cache"
+ or (($response->header('cache-control') // '') =~ /\b(?:max-age=0|no-store|no-cache)\b/)
# don't cache video or audio files
or (($response->header('content-type') // '') =~ /\b(?:video|audio)\b/);