Web cache: Difference between revisions

Content deleted Content added
Removed
Tags: Reverted references removed Mobile edit Mobile web edit
m Reverted edits by 2603:6010:34F0:8820:F55D:ABE3:B29D:E0FD (talk) (HG) (3.4.12)
Line 10:
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.
Many CDNs and manufacturers of network equipment have replaced this standard HTTP cache control with dynamic caching.
 
==Legality==