Cachable 404 responses are not cached
Categories
(Core :: Networking: Cache, enhancement, P2)
Tracking
()
People
(Reporter: ivan.zderadicka, Unassigned)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
|
187.27 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0
Steps to reproduce:
Server return responses with this header:
cache-control: public, max-age=86400
status 200 responses are cached, 404 not
Actual results:
404 responses with cache-control header are not cached
Chrome is caching such responses.
I think there are many valid use cases where caching 404s makes sense. So I think it'll make sense for FF to use same behavior as Chrome.
Expected results:
404 responses with appropriate cache-control header should be cached.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
I think this was changed in bug 1121447.
Comment 2•3 years ago
|
||
Hello Ivan, can you give us a link for any websites where you encounter this issue so we can reproduce this issue on our side ? Thanks in advance.
| Reporter | ||
Comment 3•3 years ago
|
||
Hi,
I do not have any public site - but you can easily simulate
Any response that returns something like this
HTTP/1.1 404 Not Found
Server: nginx/1.16.0
Date: Fri, 04 Nov 2022 14:44:35 GMT
Content-Type: text/plain
Content-Length: 9
Connection: keep-alive
cache-control: public, max-age=86400
can be used to test - important is the cache-control header and 404 status - such response is cached in Chrome, but not in Firefox
Comment 4•3 years ago
|
||
I havent seen the cache-control header for the 404 status in Firefox at all but I have seen it in Chrome, Based on Comment 1 this might be intended behavior but Ill open it as an Enhancement and maybe someone from our Dev team can take a look.
| Reporter | ||
Comment 5•3 years ago
|
||
@Rares - thanks,
As I've explained previously caching 404 responses is kind of "grey area" - Chrome does it, but FF does not.
It might be conscious decision on FF side.
What I wanted to explain is that in certain scenarios it makes sense to cache 404 and it should be driven by cache-control header, so that programmers can decide what's best for their application. And it would be nice if main browsers handle this consistently.
Description
•