Web cache: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted references removed Visual edit Mobile edit Mobile web edit
m Reverted edits by 5.200.125.226 (talk) to last version by MrOllie
Line 6:
 
===Forward and reverse===
A forward cache is a cache outside the [[web server]]'s network, e.g. in the client's [[web browser]], in an [[ISP]], or within a corporate network.<ref>{{cite web |url=http://www.isaserver.org/tutorials/Understanding-Web-Caching-Concepts-ISA-Firewall.html |title=Understanding Web Caching Concepts for the ISA Firewall |first=Thomas |last=Shinder |access-date=27 February 2011 |date=2 September 2008 |work=[[ISA Server]] |archive-url=https://web.archive.org/web/20110723104247/http://www.isaserver.org/tutorials/Understanding-Web-Caching-Concepts-ISA-Firewall.html |archive-date=23 July 2011 |publisher=TechGenix Ltd.}}</ref> A network-aware forward cache only caches heavily accessed items.<ref name=":0">{{cite journal |url=http://www.research.att.com/export/sites/att_labs/techdocs/TD_7LAUDD.pdf |citeseerx=10.1.1.159.1786 |title=Network-Aware Forward Caching |first1=Jeffrey |last1=Erman |first2=Alexandre |last2=Gerber |first3=Mohammad T. |last3=Hajiaghayi |first4=Dan |last4=Pei |first5=Oliver |last5=Spatscheck |journal=[[AT&T Labs]] |year=2008 |access-date=11 March 2019 |archive-url=https://web.archive.org/web/20110401145549/http://www.research.att.com/export/sites/att_labs/techdocs/TD_7LAUDD.pdf |archive-date=1 April 2011 |pages=291–300}}</ref> A [[proxy server]] sitting between the client and web server can evaluate [[HTTP]] headers and choose whether to store web content.
 
A reverse cache sits in front of one or more web servers, accelerating requests from the Internet and reducing peak server load. This is usually a [[content delivery network]] (CDN) that retains copies of web content at various points throughout a network.
 
===HTTP options===
The [[Hypertext Transfer Protocol (Secure)|Hypertext Transfer Protocol]] (HTTP) defines three basic mechanisms for controlling caches: freshness, validation, and invalidation.<ref>{{cite web |url=http://ws-rest.org/files/03-Link%20Header-based%20Invalidation%20of%20Caches.pdf |title=Using HTTP Link: Header for Gateway Cache Invalidation |access-date=14 June 2013 |first1=Mike |last1=Kelly |first2=Michael |last2=Hausenblas |pages=20 |work=WS-REST |archive-date=10 July 2010 |archive-url=https://web.archive.org/web/20100710072021/http://www.ws-rest.org/files/03-Link%20Header-based%20Invalidation%20of%20Caches.pdf |url-status=dead }}</ref> This is specified in the header of HTTP response messages from the server.
 
Freshness allows a response to be used without re-checking it on the origin server, and can be controlled by both the server and the client. For example, the Expires response header gives a date when the document becomes stale, and the Cache-Control: max-age directive tells the cache how many seconds the response is fresh for.
 
Validation can be used to check whether a cached response is still good after it becomes stale. For example, if the response has a Last-Modified header, a cache can make a ''conditional request'' using the If-Modified-Since header to see if it has changed. The [[HTTP ETag|ETag]] (entity tag) mechanism also allows for both strong and weak validation.
 
Invalidation is usually a side effect of another request that passes through the cache. For example, if a URL associated with a cached response subsequently gets a POST, PUT or DELETE request, the cached response will be invalidated.