Hello everyone, today to share a status code 304, you may have been in the previous development of chrome tools or Firebug tool to intentionally or inadvertently see it.
HTTP 304:not Modified
The standard explanation is that the not Modified client has a buffered document and makes a conditional request (typically providing a if-modified-since header indicating that the customer only wants to update the document over the specified date). The server tells the customer that the original buffered document can continue to be used.
Such as:
In the request head there are: If-modified-since:mon, 01:53:41 GMT
In the response, there are: Last-modified:mon, 01:53:41 GMT
Let's compare these two dates and minutes and seconds are exactly the same, and if you get the content from the cache in a consistent way
We saw in the picture a It Cache-control
If the Cache-control:no-chache description forces each request to be sent directly to the source server, without the checksum of the locally cached version.
If there are two cases of cache-control:max-age=0:
1, max-age>0 directly from the browser cache to extract
2, max-age<=0 to the server to send an HTTP request confirmation, whether the resource has been modified to return 200, no words return 304.
First time Visit 200
Mouse click two times Access (Cache)
Press F5 to refresh 304
Press Ctrl+f5 to force refresh 200
Parsing an HTTP request returns a 304 status code