summaryrefslogtreecommitdiff
path: root/src/Network/URI/Cache.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/URI/Cache.hs')
-rw-r--r--src/Network/URI/Cache.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Network/URI/Cache.hs b/src/Network/URI/Cache.hs
index c84e11a..d8b9b50 100644
--- a/src/Network/URI/Cache.hs
+++ b/src/Network/URI/Cache.hs
@@ -36,11 +36,9 @@ shouldCacheHTTP :: Response b -> Bool
-- IETF RFC7234 Section 3
shouldCacheHTTP response = -- Assume GET
statusCode (responseStatus response) `Prelude.elem` [200, 201, 404] && -- Supported response code
- isNothing (httpCacheDirective response "no-store") && -- Honor no-store
- True && -- This is a private cache, don't check for Cache-Control: private
- (isJust (lookup hExpires $ responseHeaders response) || -- Support Expires: header
- isJust (httpCacheDirective response "max-age") ||
- isJust (httpCacheDirective response "public")) -- Override directive
+ isNothing (httpCacheDirective response "no-store") -- Honor no-store
+ -- This is a private cache, don't check for Cache-Control: private
+ -- Also, I'll cache anything for supported response codes, regardless of explicit expiry times.
uriToString' uri = uriToString id uri ""
parseHTTPTime str | ',' `L.elem` str = parseTimeM True defaultTimeLocale rfc822DateFormat str