Analyze the HTTP request and return the status code 304. The request returns the status code 304.

Source: Internet
Author: User
Tags chrome tools

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.