Analyze the HTTP request and return the status code 304. The request returns the status code 304.
Hello everyone, today I will share with you a status code of 304. You may see it intentionally or unintentionally when you open chrome tools or firebug tools in previous development.
HTTP 304: Not Modified
The standard interpretation is: The Not Modified client has a buffered document and issued a conditional request (generally, the If-Modified-Since header is provided to indicate that the customer only wants to update the document on a specified date ). The server tells the customer that the original buffer documentation can still be used.
For example:
In the request header, If-Modified-Since: Mon, 17 Aug 2015 01:53:41 GMT
In the response header: Last-Modified: Mon, 17 Aug 2015 01:53:41 GMT
We can compare these two dates to get the content from the cache if they are consistent.
We see a cache-control in the image.
If cache-control: no-chache indicates that each request is sent directly to the source server without being verified by the local cache version.
If cache-control: max-age = 0, there are two cases:
1. When max-age is greater than 0, it is extracted directly from the browser cache.
2. When max-age <= 0, an http request is sent to the server to confirm whether the resource has been modified. If not, 200 is returned. If not, 304 is returned.
The first access 200
Click the second access (Cache)
Press F5 to refresh 304
Press Ctrl + F5 to forcibly refresh 200