From c624698bdb859e1ac1f86659b92e0fd802be0f51 Mon Sep 17 00:00:00 2001 From: trizen Date: Wed, 4 Nov 2020 02:12:53 +0200 Subject: Don't cache if "cache-control" says "no-cache". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 4 ++-- 1 file 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/); -- cgit v1.2.3