This chapter demonstrates about the HTTP2 Cache. Infrastructure which already available on the internet if user going to dump everything from the scrap obviously which is not realistic following are the concepts are covered in this chapter.
Caching
Proxies
Caching
Description
In order to define the caching HTTP is defined by the few headers which are named as the
Expires Header
ETag Header
Cache-Control Header
The figure is demonstrates the caching in HTTP is as shown below.
Expires Header
Description
Expire header is defined as the server can send exact expiry date for specific resource. When the client get these in the header ignores the resource going to expires of cores if it tries to makes the same request, if the browsers sees that date is passed then user need to make a new request to the server other wise it just uses the cache.
ETag Header
Description
ETag is known as the expires tag. When user can specify the expiry based on date. Some time resource has been sent by not using the cache version by the browser only when something has changed. lets take according to the customer if the client not makes the request to the server then client can send the header which is if not match with the actual hash. If the server sees that the has not change it would just send back a not modified other wise response with the resource sending the hash of the resource on the next request the client can check again.
Cache-Control Header
Description
Cache Control is the most commonly used Header and which is introduced in HTTP 1.1 and is basically override the expires max age attribute for the cache control. Which is basically defines in seconds, how long resource has before it expires and which is the better essence of using expires, because user need not to worry about the syncing of the clocks. It just know after the few seconds resource has expires.
Cache control not introduced only Max age which is also introduced is shown below.
no-cache
Which means the client needs to request the URL again from the server to make sure the no changes have been made so consequently at this point ETag header could be used to detect the changes.
no-store
Which means do not allow browsers intermediate services to store the data.
The other values also Cache control introduced
Public
Which means resource can be cached even if require an authentication and usually when something like Max-age it is public by default so if don't explicitly have to send the value public.
Private
Which means it can only cached by the browser and not intermediate services or content delivery networks.
Proxies
Description
HTTP/2 greatly depends on the type of proxy, does it nearly want to cache a request, is it their for any intercepting or login traffic, when it comes to proxy intercept an traffic is the same what ever the restrictions are apply to TLS those restrictions are applied here.
HTTP/2 has support for the connect method which is used to establish tunnel over single HTTP/2 stream turn more host much like the way works in HTTP 1.1.
HTTP/2 also have the Trusted Proxy which tries address the some of the in particular with the HTTP/2 in terms of traffic interceptions etc.
Summary
Key Points
Expires Header defines the server expiry date.
Etag specify the expiry date based on system date.