$ OK (from cache) with 304 not Modified

Source: Internet
Author: User
Tags browser cache

Explain:

The "from cache" is the browser does not confirm with the server, directly using the browser cache;

304 Not Modified is a cache that the browser and server have confirmed more than once for cache validity.

Trigger difference:

The "from cache" is a direct click on the link to access, the input URL can be triggered by the return access, while 304 not Modified is triggered when the page is refreshed, or set a long cache, but the Entity Tags are not removed when the trigger

Last-modified This header is a response header that indicates the last modification time of the requested resource on the server side of the client (usually referred to as a browser). Typically, after the client accepts this header, a request for the resource will be included with a ' if-modified-since ' request header at a later time, and this header is to tell the server when the last modification was made to the resource requested by the client. The content behind If-modified-since is to confirm to the server whether the content in the browser cache is outdated. If it is not obsolete, the return is 304 not Modified.

The $ OK from cache isExpires 和 Cache-Control: max-age来比较的。如果你触发一条新的请求的时候,这些缓存对象仍然存储在本地缓存并且尚未过期

If your server is Apache, use the ExpiresDefault directive to set a expiration date relative to the current date. This example of the ExpiresDefault Directive sets the Expires date years out from the time of the request.

If your server is Apache use the ExpiresDefault directive to set a relative to the current date due date. This example expiresdefault instruction set request time 10 expires.

ExpiresDefault "Access plus ten Years"

Yahoo! Web Optimization Recommendations: https://developer.yahoo.com/performance/rules.html

$ OK (from cache) with 304 not Modified

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.