Why Browser Send No Cache In Http Request Cache Control Header

When you browse any web page ( google.com, yahoo.com, bing.com ) in modern web browser, if you inspect the request http headers, you can find cache-control : no-cache header. This header is always used in http response header. But why it is used in http request header, this article will tell you the reason.

If you do not know how to view the http request headers with google chrome inspector, you can read article How To View HTTP Headers, Cookies In Google Chrome, Firefox, Internet Explorer.

cache-control no-cache in google request http header

1. What Dose cache-control : no-cache Means.

The cache-control header no-cache value will tell the intermediary proxies do not return the cached web resource back to me immediately even the cached web resource is fresh ( not expired ). It tell the intermediary proxies to communicate with the original web server to check whether the web resources has been modified or not. If not modified since last check then return the cached version directly, otherwise the intermediary proxies need to update the cached web resource to the newest version and return the newest version back to client browser.

This action will make client browser communicate with original web server, but if the web resource is not expired, it do not need to re-download the web page again. So in this way, we can make sure the web content is updated and reduce the web traffic.

2. Why Modern Web Browser Send cache-control: no-cache In Http Request Header.

The main reason is because of security especially for important website such as bank account login page. This way can make sure the returnd web page is sent from the original web server, not modifed by any intermediary proxy server. Because hackers can inject code in the proxy server to monitor user actions and save user data.

READ :   How To Modify Http Response Header In WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.