Sunday 20 July 2014

CACHING


If a user revisits a web page after a short interval, the browser may not need to re-obtain the page data from the source web server. Almost all web browsers cache recently obtained data, usually on the local hard drive. HTTP requests from a browser usually ask only for data that has changed since the last download. If locally cached data is still current, the browser reuses it. Caching reduces the amount of web traffic on the Internet. Decisions about expiration are made independently for each downloaded file, whether image, stylesheetJavaScript, HTML, or other web resource. Thus even on sites with highly dynamic content, many basic resources refresh only occasionally. Web site designers find it worthwhile to collate resources such as CSS data and JavaScript into a few site-wide files so that they can be cached efficiently. This helps reduce page download times and lowers demands on the web server.
There are other components of the Internet that can cache web content. Corporate and academic firewalls often cache Web resources requested by one user for the benefit of all. (See also caching proxy server.) Some search engines also store cached content from websites. Apart from the facilities built into web servers that can determine when files have been updated and so must be re-sent, designers of dynamically generated web pages can control the HTTP headers sent back to requesting users, so that transient or sensitive pages are not cached. Internet banking and news sites frequently use this facility. Data requested with an HTTP 'GET' is likely to be cached if other conditions are met; data obtained in response to a 'POST' is assumed to depend on the data that was Posted and so is not cached.

No comments:

Post a Comment