we are working on reducing some 'pointless' traffic.
if we send valid cache control headers (a-la "do cache") with a 404 response, will modern browsers cache that the requested resource does not exist?
we use a custom php based 404 handler that was sending do not cache headers due to session creation, so we removed those. but now are wondering if for resources we are CERTAIN are invalid, should we send proper cache headers?
these are public resources btw accessed by the same uri by all users.
thanks!
Modern Browsers have an implementation of the HTTP Protocol ideally close to the standard, same for proxy servers which you should take into account if you like to have an effect on user- and non-intentional-bot-traffic. The current version is 1.1, some excerpts:
More specifically for 404:
So much for the 404 response code.
You asked:
You've not given any specific cache headers you'd like to use, so it's a bit unprecise to answer your question. Caching is a section of it's own in the protocol specification: 13 Caching in HTTP.
Generally the following should be what you're looking for, excerpt from 13.1.1 Cache Correctness:
So you can cache 404 response messages and signal them to cache. Proxies and Clients should handle it.