Cisco Cisco Customer Voice Portal 8.0(1) Guia Do Desenho

Página de 223
 
12-5
Cisco Unified Customer Voice Portal (CVP) 8.x Solution Reference Network Design (SRND)
OL-15989-06
Chapter 12      Media File Options
Configuring Caching and Streaming in Cisco IOS
connections have the same host IP address and port number. This kind of connection is referred to as a 
persistent connection. As the name implies, the connection can last over a long period of time without 
being shut down.
To establish a persistent connection, both the client and the server must agree that the connection is going 
to be a persistent one. To configure the Cisco IOS HTTP Client to request a persistent connection from 
the server, configure the following command:
http client connection persistent
Cache Aging
The HTTP Client manages its cache by the "freshness" of each cached entry. Whether a cached entry is 
fresh or stale depends on two numbers: Age and FreshTime. Age is the elapsed time since the file was 
last downloaded from the server. FreshTime is the duration that the file is expected to stay fresh in the 
HTTP Client cache since the file was last downloaded.
There are several variables that can affect the FreshTime of a file, such as HTTP message headers from 
the server and the cache refresh value configured via the command line interface (CLI).
The FreshTime of a file is determined in the following sequence:
1.
When a file is downloaded from the HTTP server, if one of the HTTP message headers contains the 
following:
Cache-Control: max-age = <value in seconds>
Then the max-age is used as the FreshTime for this file.
2.
If step 1 does not apply, but the following two headers are included in the HTTP message:
Expires: <expiration date time>
Date: <Current date time>
Then the difference (Expires – Date) is used as the FreshTime for this file.
3.
The HTTP/1.1 spec, RFC 2616 (HyperText Transport Protocol), recommends that either one of the 
HTTP message headers as described in step 1 or 2 above should be present. If the server fails to send 
both 1 and 2 in its HTTP response, then take 10% of the difference between Date and Last-Modified 
from the following message headers:
Last-Modified: <last-modified date time>
Date: <Current date time>
So the FreshTime for this file is calculated as:
FreshTime = 10% 
∗ ((Date) – (Last-Modified))
4.
The CLI allows the user to assign a FreshTime value to the files as a provisional value in case none 
of the message headers in steps 1 to 3 are present:
http client cache refresh <1-864000>
The default refresh value is 86400 seconds (24 hours).   The configured HTTP Client cache refresh 
has no effect on files when any of the message headers in steps 1 to 3 are present. But if the resultant 
FreshTime from the CLI command calculation turns out to be less than the system default (which is 
86400 seconds), the FreshTime will be set to the default value (86400 seconds). This command is 
also not retroactive. That is, the newly configured refresh value applies only to new incoming files, 
and it has no effect on the entries already in the cache.