The 304 Not Modified HTTP server response code indicates that the requested resource has not been modified since the last time it was loaded, and there’s no need to transfer it again.
For browsers, this means that the cached version of the resource can be shown to the user. For crawlers, such as Googlebot, it means that there’s no need to recrawl the page because nothing has changed on it.
Here’s how it works (in simple terms):
ETag
. The client also records the time when it requested the page/resource.If-None-Match
and/or If-Modified-Since
request readers from the client. This is a so-called conditional HTTP request.
If-None-Match
contains the ETag
(content hash code). If it matches the value on the server, this indicates that the content has not been changed, and there’s no need to load it again (when the content changes, so does its hash code).
If-Modified-Since
contains the date and time when the client last requested the content. If the server sees that content was not changed since this date, there’s no need to send the resource to the client.
In both cases, the server will respond with the 304 HTTP code.
When both If-None-Match
and If-Modified-Since
are used, If-None-Match
takes precedence over If-Modified-Since
.
For small websites, the caching opportunities that the 304 HTTP code provides are not that crucial.
However, for large websites, the 304 response code is a great opportunity to save the crawl budget. Google’s crawler won’t recrawl the pages that were not changed and will be able to crawl more new and updated pages instead.