.1 /1 P TT

advertisement
HTTP/1.1
Tianhao Wu
Problems With HTTP/1.0
A hop-by-hop mechanism
Transfer coding
Virtual hosting
Ensuring semantic transparency in caching
Support for variants of a resource
New Concepts In HTTP/1.1
Hop-by-hop headers cannot be stored by
caches or forwarded by proxies.
– For example: they may use a better
compression algorithm not available to other
components in the message exchange chain.
It is possible that a pair of adjacent
intermediaries in the path could use an
alternate way to exchange HTTP messages
Hop-By-Hop Mechanism
Transfer Coding
Download:
Compile:
Examples:
www.W3C.org
Methods, Headers, and Response Codes
Differences between HTTP/1.0
and HTTP/1.1
Request Methods
General Headers
Request Headers
Response Headers
Entity Hearders
Response Status Codes
a Cache is a store of responses
for later reuse
Caching
– the length of time between response generation and
expiration time
Freshness Lifetime and Staleness:
– the origin server set the time after which the cache
must revalidate the entity before returning it as a
response
Expiration Time
– The time since the entity was sent by the origin server
– The time since it was revalidated as fresh by the cache.
Age
Caching Related Terms
–
–
–
–
–
Cacheability of a response
Duration of time a response can be cached
When to revalidate
Cache Maintenance
Whether a response should be stored
Cacheability
Caches can check with the origin server to see if the
cached copy of the resource is fresh.
Revalidation:
Caching Related Terms
(continue)
– A request directive (Pragma: no-cache)
– A modifier to the GET request (If-ModifiedSince)
– A response header (Expires)
Caching Control
Caching in HTTP/1.0
Caching Design in HTTP/1.1
Cache-control Request
Cache-control response
– Different version of the same entity has
different ETag
Entity tags is an opaque validator for
comparing a cached entry against a
possibly newer version.
ETag
Bandwidth
Optimization
Why?
How?
Users may only need middle part of a large resource
If a resource is continuously growing, users may only be
interested in the new portion.
User may use multiple parallel connections to fetch
different parts simultaneously and reconstruct them
Range Request
– Expect mechanism provides precisely a solution to let
the client know whether the server would be able to
meet the expectation of the client.
– Clients can also include additional values such as
authentication information with an expectation header.
If an HTTP server is unable to handle large
requests, it would be useful for the client to know
this before the request is sent.
Expect/Continue
– Content coding: end-to-end coding
– Transfer coding: hop-to-hop coding
A good way to conserve bandwidth is to
compress the response in a manner
acceptable to the receiver
Compression
Download