However, in cases where the document has changed, it would be very inefficient to make a second connection to the remote server to do the actual GET request to retrieve the document. The overhead of making a connection is often considerable.
If-Modified-Since
request header, making it possible to do a
conditional GET request. The GET request is otherwise the same except
that this header contains the date and time that the object currently
in the client (proxy cache) was last modified. If the document has not been modified since the date and time specified it will not be sent back, instead a 304 (Not modified)response with only the relevant object meta-information headers, such as a new expiry date will be returned, along with a special result code. If the document has been modified it will be sent back as if the request was just a normal GET request.
The conditional GET makes several types of utilities more efficient. It can be used by mirroring software that has to refresh a large number of files on a regular basis. The caching proxy server could refresh its cache regularly during periods of client inactivity, not just at times when a document is explicitly requested.
It's worth noting that the conditional GET header is backward compatible. HTTP is defined so that unknown header fields are ignored. If the remote HTTP server does not support the conditional GET request no harm will be done, the server will just send the document in full. Fortunately all the major HTTP servers already support the conditional GET header.
Pragma
HTTP request header field was added to the
HTTP specification. There is currently only on pragma defined, but in
the future we can foresee many others.
If the client issues the no-cache
pragma to the proxy
server it will cause any cache file to be ignored and forces the proxy
to make a request to the remote server. Naturally, this request is a
conditional GET request with respect to the current cache file.
The no-cache
pragma is typically used by clients
Reload
operation, i.e. when the client reloads a document
it should send the no-cache
pragma at the same time. This
provides users the possibility of doing a cache refresh with no
visible modifications in the user interface.
no-cache
pragma is forwarded by the proxy server, thus
insuring that if another proxy is used also the cache on that server
is ignored.