\section{Caching}
\label{sec:caching}

In HTTP, response-request pairs are cached.  RTSP differs significantly
in that respect.  Responses are not cachable, with the exception of the
presentation description returned by {\sf DESCRIBE} or included with
{\sf ANNOUNCE}.  (Since the responses for anything but {\sf DESCRIBE}
and {\sf GET\_PARAMETER} do not return any data, caching is not really
an issue for these requests.) However, it is desirable for the
continuous media data, typically delivered out-of-band with respect to
RTSP, to be cached, as well as the session description. 

On receiving a {\sf SETUP} or {\sf PLAY} request, a proxy ascertains as
to whether it has an up-to-date copy of the continuous media content and
its description.  It can determine whether the copy is up-to-date by
issuing a {\sf SETUP} or {\sf DESCRIBE} request, respectively, and
compare the {\sf Last-Modified} header with that of the cached copy.  If
not, it modifies the {\sf SETUP} transport parameters as appropriate and
forwards the request to the origin server.  Subsequent control commands
such as {\sf PLAY} or {\sf PAUSE} then pass the proxy unmodified.  The
proxy delivers the continuous media data to the client, while possibly
making a local copy for later re-use.  The exact behavior allowed to the
cache is given by the cache-response directives described in
Section~\ref{sec:Cache-Control}.  A cache MUST answer any {\sf DESCRIBE}
requests if it is currently serving the stream to the requestor, as it
is possible that low-level details of the stream description may have
changed on the origin-server.

Note that an RTSP cache, unlike the HTTP cache, is of the
``cut-through'' variety.  Rather than retrieving the whole resource from
the origin server, the cache simply copies the streaming data as it
passes by on its way to the client, thus, it does not introduce
additional latency.

To the client, an RTSP proxy cache appears like a regular media server,
to the media origin server like a client.  Just like an HTTP cache has
to store the content type, content language, and so on for the objects
it caches, a media cache has to store the presentation description. 
Typically, a cache eliminates all transport-references (that is,
multicast information) from the presentation description, since these
are independent of the data delivery from the cache to the client. 
Information on the encodings remains the same.  If the cache is able to
translate the cached media data, it would create a new presentation
description with all the encoding possibilities it can offer. 
