Applies To:

Show Versions Show Versions

Manual Chapter: Configuring Lifetime Rules
Manual Chapter
Table of Contents   |   << Previous Chapter   |   Next Chapter >>

10 
The length of time that the WebAccelerator system keeps compiled content in its cache before refreshing it is called content lifetime. Content lifetime is expressed in the form of time to live (TTL) value and can vary for each cached response. When content is in the WebAccelerator systems cache longer than its TTL value, the WebAccelerator system considers the content expired. When the WebAccelerator system receives a request for expired content, it sends that request to the origin web servers for fresh content, replaces the expired cached content with the fresh response, and then responds to the request.
You use lifetime rules to identify content lifetime options and age settings for compiled responses. Additionally, you identify content that you do and do not want the WebAccelerator system to cache, and set a TTL value for cached responses.
You can also manage the caching options for a clients browser, by having the WebAccelerator system override the HTTP Cache-Control Expires headers max-age directive. For more information, see Defining the client cache settings.
Lifetime rules are not relevant to requests. The WebAccelerator system applies lifetime rules only to matching responses. The content lifetime options and WebAccelerator cache settings associated with lifetime rules are described in Reviewing headers options and directives for content lifetime. and Defining the WebAccelerator systems cache settings.
In addition to the lifetime rule options, you can also change the system-wide minimum and maximum age parameters by editing the WebAccelerator systems configuration file. See Specifying system-wide age parameters, for more information.
WebAccelerator system cache settings, which include maximum age, stand-in period, and HTTP lifetime heuristic
The settings for content lifetime and HTTP lifetime header options, which determine if the WebAccelerator system should obey the age information provided in the ESI headers and HTTP lifetime headers sent from the origin web server, or set its own
Because the WebAccelerator system manages cached responses by using different lifetime methods and parameters simultaneously, it obeys a precedence to manage any potential conflict. If one or more values for these mechanisms conflict, the WebAccelerator system uses the following precedence:
The TTL values for compiled responses, which you define as the Maximum Age value in the WebAccelerator Cache Settings section, cannot be greater than the system-defined maximum lifetime values and cannot be shorter than the system-defined minimum lifetime values. See Reviewing headers options and directives for content lifetime for more information.
If you configure the Maximum Age value in the WebAccelerator Cache Settings section, you cannot configure a lifetime mechanism with a TTL greater than the Maximum Age value that you specified.
If you enable the Obey ESI max age if present option in the Content Lifetime Rule section, the TTL value indicated by the ESI Surrogate-Control headers max-age directive supersedes all other TTL values, provided that the ESI Surrogate-Control headers max-age value does not violate the boundary conditions described in the previous two bullets.
The WebAccelerator system uses the HTTP lifetime headers only if you have configured a lifetime rule with the Use HTTP lifetime headers option enabled and an ESI Surrogate-Control headers max-age directive is not included in the header.
If the lifetime rule indicates that the WebAccelerator system should not use a lifetime mechanism, or if HTTP lifetime headers are not otherwise available, then the WebAccelerator system uses the Maximum Age value that you specified in the WebAccelerator Cache Settings section of the lifetime rule.
If you have not configured a lifetime mechanism or specified a Maximum Age value in the WebAccelerator Cache Settings section, the WebAccelerator uses the system-defined maximum lifetime value for the content lifetime TTL value.
You organize lifetime rules in the Policy Tree, with any associated lifetime rules assigned to the leaf node. The WebAccelerator system applies lifetime rules only against leaf nodes in the Policy Tree. The lifetime rules defined for a leaf node are a combination of the lifetime rules and age settings defined locally at the node and any lifetime rules and age settings that are inherited from the nodes ancestors. (For information about inheritance support in the Policy Tree, see Understanding rule inheritance within the Policy Tree.)
When defining options for a content lifetime rule, you can configure the WebAccelerator system to honor the settings for the lifetime headers defined in Table 10.1.
ESI Surrogate-Control headers
You can define control directives in the ESI Surrogate-Control response header to specify content TTL values.
HTTP Cache-Control headers
You can use HTTP Cache-Control response header tags to define TTL values.
When responding to sites that use Edge Side Includes (ESI) for assembly, the origin web server sends the WebAccelerator system ESI Surrogate-Control headers, along with the HTTP response headers. (See Appendix C, Assembling Content with Edge Side Includes for more information.)
If you enable the lifetime rules HTTP lifetime header option, Obey ESI max age if present, the WebAccelerator system uses the max-age directive included in the ESI Surrogate-Control headers as the TTL value for compiled responses. If you do not want the WebAccelerator system to store cached ESI responses, you can use the ESI Surrogate-Control headers no-store directive. For specific instructions about how to specify the ESI Surrogate-Control header directives, see Appendix B, Processing HTTP Headers.
Important: The ESI Surrogate-Control headers max-age directive is not the same as the system-wide maximum age parameter or the value of the Maximum Age setting for the lifetime rules WebAccelerator system Cache Settings. You use the ESI Surrogate-Control headers max-age directive to define an actual TTL for content. The system-wide maximum age parameter and the lifetime rules Maximum Age setting are a boundary condition beyond which, for example, the ESI Surrogate-Control headers max-age directive cannot pass. For more information about system-wide age parameters, see Specifying system-wide age parameters.
The HTTP Cache-Control version 1.1 header specification identifies headers that you can use to control web entities, such as the WebAccelerator system. For additional information, see sections 13 and 14 of the HTTP/1.1 specification at http://www.w3.org/Protocols/rfc2616/rfc2616.html.
When you enable the Use HTTP lifetime headers if present option in the HTTP Lifetime Header Options section of the lifetime rule screen, the WebAccelerator system uses any existing HTTP Cache-Control headers, and manages content based on the following associated cache directives:
HTTP Cache-Control headers can appear on requests sent by clients and on responses sent by the origin web servers. The HTTP Cache-Control general-header field specifies directives for all caching mechanisms along the request/response chain, and is used to prevent caching behavior from adversely interfering with the request or the response. Some directives can appear only in request headers, and some can appear only in response headers, and certain directives can appear in either type of header. The HTTP Cache-Control general-header field directives typically override any default caching algorithms.
Note: If the origin web server returns ESI Surrogate-Control headers in an HTTP response, the WebAccelerator system ignores any existing HTTP 1.1 Cache-Control headers. For example, if a response includes an ESI Surrogate-Control header with a max-age directive and an HTTP 1.1 Cache-Control header with a no-cache or no-store directive, the WebAccelerator system caches the response in accordance with the ESI Surrogate-Control header. To override this behavior, you can configure a lifetime rule to prompt the WebAccelerator system to ignore the ESI Surrogate-Control headers max-age directive, by disabling the Obey ESI max age if present option. For additional information about ESI, see Appendix C, Assembling Content with Edge Side Includes.
If you disable the Ignore no-cache HTTP headers in the response option in the HTTP Lifetime Header section of the lifetime rule screen, the WebAccelerator system uses the cache response directives that it receives from the origin web server. The origin web servers cache response directives are organized in two groups:
no-cache
These are directives that prompt the WebAccelerator system to not cache a response.
max-age
These are directives that the WebAccelerator system uses to help determine the TTL value for compiled response.
The HTTP Cache-Control headers no-cache directives prompt the WebAccelerator system to send a request to the origin web servers, and also dictate whether the WebAccelerator system should cache the response. You can enable the lifetime rules, Ignore no-cache HTTP headers in the request option to prompt the WebAccelerator system to ignore the HTTP Cache-Control headers no-cache directives. Doing so may result in a noticeable drop in the traffic sent to the origin web server, depending on how many users send no-cache directives in their requests.
The no-cache directives are described in Table 10.2.
Table 10.2 HTTP Cache-Control headers no-cache directives
Pragma: no-cache
If the pragma general-header field specifies no-cache, the WebAccelerator system does not cache the response.
If Cache-Control general-header field specifies no-cache, the WebAccelerator system does not cache the response.
If Cache-Control general-header field specifies no-store, the WebAccelerator system does not cache the response.
If Cache-Control general-header field specifies private, the WebAccelerator system does not cache the response.
For more information about this directive, see Section 14.9.1 of the HTTP 1.1 specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1
For HTTP Cache-Control headers, the WebAccelerator system uses the value for the directives defined in Table 10.3, in order of priority, to determine the TTL values for compiled responses. For example, if the TTL values for the s-maxage and the max-age directives are different, the WebAccelerator system uses the TTL value for the s-maxage directive.
The max-age directives are described in Table 10.3.
Table 10.3 HTTP Cache-Control headers max age directives
The WebAccelerator system bases the TTL on the current time, plus the value specified for the Cache-Control headers s-maxage directive. Values for this directive are expressed in seconds.
The WebAccelerator system bases the TTL on the current time, plus the value specified for the Cache-Control headers max-age directive. Values for this directive are expressed in seconds.
The WebAccelerator system uses the TTL provided for Cache-Control headers entity-header field. Values for this field are expressed in Coordinated Universal Time (UTC time).
To avoid potential issues, it is important to ensure that that the WebAccelerator system is properly synchronized with the origin web server, therefore, F5 Networks highly recommends that you configure a Network Time Protocol (NTP) server.
For information about configuring NTP on the BIG-IP system, refer to the BIG-IP Network and System Management Guide, which is available on the Technical Support web site, http://tech.f5.com.
For information about this header field, see section 14.21 of the HTTP 1.1 specification:
curr_time is the time that the response is received by the WebAccelerator system
last_mod_ time is the time specified by this directive
last_mod_factor is a percentage value used to weight the TTL. You set it with a lifetime rule.
For information about this header field, see section 14.29 of the HTTP 1.1 specification:
Important: The HTTP Cache-Control headers max-age directive is not the same as the system-wide maximum age parameter or the value of the Maximum Age setting for the lifetime rules WebAccelerator system Cache Settings. You use the HTTP Cache-Control headers max-age directive to define a TTL for content. The system-wide maximum age parameter and the lifetime rules Maximum Age setting is a boundary condition beyond which, for example, the HTTP Cache-Control headers max-age directive cannot surpass. For more information about system-wide age parameters, see Specifying system-wide age parameters.
In general, freshness calculations for HTTP headers are based on the date or age value received in the HTTP response, as defined in section 13.2.3 of the HTTP version 1.1 specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.3
However, the WebAccelerator system assumes that the values for date and age are 0, so it bases all age calculations on the time that it receives a response from the origin web server.
The time delay between when a response leaves the origin web server and it is received by the WebAccelerator system.
In most cases, these issues are negligible, however, to ensure that the WebAccelerator system maintains proper synchronization with the origin web server, F5 Networks highly recommends that you configure a Network Time Protocol (NTP) server. For information about configuring the NTP server, see the Configuration and Maintenance chapter in the Administrator Guide for the BIG-IP® WebAccelerator System.
Clients that are HTTP version 1.1 compliant are capable of providing request headers, which contain directives that control cache behavior. The WebAccelerator system obeys these directives when they indicate that the client is unwilling to accept content served from a cache.
If the client sends an HTTP request header that prevents the WebAccelerator system from serving the content from its cache, the WebAccelerator system sends the request to the origin web server. This event prompts the WebAccelerator system to refresh the corresponding content that it has cached, even if that content has not yet expired.
When using HTTP Cache-Control headers, the WebAccelerator system uses the cache request directives described in Table 10.4.
If the Pragma general-header field includes the no-cache directive, the WebAccelerator system sends the request to the origin web servers.
If Cache-Control specifies no-cache, then the WebAccelerator system sends the request to the origin web servers.
If Cache-Control specifies no-store, the WebAccelerator system sends the request to the origin web server.
If the value specified on Cache-Control: max-age is less than the current age of the cached content, the WebAccelerator proxies the request.
curr_time is the time that the request is received by the WebAccelerator system.
min_fresh_time is the time specified by this directive.
content_TTL is the time to live value set for the compiled response that corresponds to the request.
If you want the WebAccelerator system to ignore HTTP request no-cache headers and to serve responses from cache, in accordance with the configured lifetime rules, you can enable the lifetime rules Ignore no-cache HTTP headers in the request option.
These configured settings apply to any HTTP response that matches to a leaf node for a specific policy for which the option is set.
The WebAccelerator cache setting, Maximum Age, dictates the amount of time that the WebAccelerator system should store content, before requesting fresh content from the origin web server.
The WebAccelerator cache setting, Stand-in Period, identifies how long the WebAccelerator system continues to serve content from its cache, if the origin web server does not respond to the WebAccelerator systems requests for fresh content. If the WebAccelerator system still cannot retrieve fresh content from the origin web server after the stand-in period expires, it responds to subsequent requests for that content with an HTTP 404 (page not found) response.
The default stand-in period is 0. If you do not specify a stand-in period, the WebAccelerator system immediately responds with an HTTP 404 response code, if content expires and the WebAccelerator system still cannot obtain fresh content from the origin web servers.
Note: You can also specify a stand-in period using the ESI Surrogate-Control response headers max-age directive. See Using ESI Surrogate-Control Headers, for details.
The WebAccelerator cache setting, HTTP Lifetime Heuristic, determines the expiration of content based on a specified percent of time since the content was last modified. To determine the HTTP Lifetime Heuristic, the WebAccelerator system reviews the value for the HTTP LAST_MODIFIED response header, and computes the cache expiration based on the defined percentage of the number of hours since it was modified. The formula for this calculation is:

((current time - HTTP LAST_MODIFIED response header = X) * (lifetime heuristic)) + (current time) = content expiration
For example if the HTTP LAST_MODIFIED response header specifies that the object was last modified at 9:00 am, the current time is 11:00 am, and the HTTP Lifetime Heuristic setting value is 50%, then the content expiration is 12:00 pm.
The HTTP Lifetime Heuristic setting is only in effect if you are using HTTP headers to identify content lifetime. Use this setting only if you want to use the HTTP LAST_MODIFIED response header to set compiled response TTL values.
These configured settings apply to any HTTP response that matches to a leaf node for a specific policy for which the option is set.
When selected, the client cache setting, Do not change, directs the client browser to use the cache settings that are defined in the headers sent from the origin web server.
The value defined for the client cache setting, Maximum Age, dictates how long the client browser locally stores content. The WebAccelerator uses the Maximum Age value to override the HTTP Cache-Control Expires header and max-age directive that the origin web server sends to the client. The WebAccelerator will override the max-age directive from the origin web server only if the new value for the max-age is greater than the value supplied by the origin web server.
Note: When a user clicks the browsers Refresh button, most browsers update their cache with fresh content immediately, even before the value defined for the Maximum Age setting is met.
The Maximum Age value specified for the client cache setting applies even if the WebAccelerator system has invalidated the compiled response in its cache (see Chapter 11, Configuring Invalidations Rules). Do not increase the Maximum Age value unless there is an acceptable trade off between the freshness of the content, and overall site performance.
Important: If the Assembly rules Intelligent Browser Referencing feature is enabled, then the WebAccelerator system ignores the client cache settings Maximum Age value for any objects it loads through the Intelligent Browser referencing feature. The top-level HTML page still uses the client cache settings Maximum Age value, if defined. See Using parameter value substitution, for more information.
When enabled, the Insert no-cache directive into header client cache setting prompts the WebAccelerator system to insert a no-cache directive into the HTTP Cache-Control header that is returned from the server. This header instructs the client browser not to cache content.
You can set and modify the system-wide age parameters by editing the WebAccelerator systems configuration file. For information about changing the system-wide age parameters in the /config/wa/pvsystem.conf file, see theChanging Configuration Options chapter in the Administrator Guide for the BIG-IP® WebAccelerator System.
The system-wide maximum age parameter, which is 24 hours by default, overrides any other lifetime mechanism configured. Therefore, the WebAccelerator system ignores lifetime mechanisms that have a TTL for compiled response set at a higher value than the system-wide maximum age.
Note: If you set the system-wide maximum age value to 0, it forces the WebAccelerator system to send a GET-IF-MODIFIED request to the origin web server, re-validating all content before serving it from its cache. If you want to use a maximum age value of 0, make sure the system-wide minimum age parameter is also set to 0.
The default value for the system-wide minimum age parameter value is 2 seconds. If you set the lifetime rules WebAccelerator cache setting, Maximum Age, with a value less than the value for the system-wide minimum age parameter, the WebAccelerator system uses the value set for the system-wide minimum age parameter, instead of the value set for the system-wide maximum age parameter.
This section of the chapter provides information about how to configure an example lifetime rule. For this example site, you have three top-level nodes in the Policy Tree as follows:
Home
This branch node specifies the rules related to the home page.
Applications
This branch node specifies the rules related to the applications for the site, with the following leaf nodes:
Default
This leaf node specifies the rules related to non-search related applications.
Search
This leaf node specifies the rules related to your sites search application.
Images
This branch node specifies the rules related to graphics images.
Note: See To create the Home, Application, and Images nodes for the example Policy Tree, for specific instructions about how to create the Policy Tree.
Your home page and image files rarely change, therefore, you use the WebAccelerator system to cache the home page and images in accordance with its default settings. If you make a change to the home page, you use some form of content invalidation to force a refresh for the new content. (See Chapter 11, Configuring Invalidations Rules, for more information about content invalidation.)
The content that your general applications serve changes about once every 4 hours. You use some form of content invalidation to force a refresh when content changes, but you do not want this content to remain in the WebAccelerator systems cache for more than 5 hours without a refresh. To ensure that you can manage content invalidation, you do not want to rely solely on the browsers local cache settings, so you do not have a minimum time set for content residing in the browser cache before performing a check for content freshness.
Your search application returns data that has various expiration times; some content expires in as little as 10 minutes, and some content expires at 8 hours. You intend to use the HTTP Cache-Control Expire header max-age directive to identify the cache time for content served by the search application.
You change your sites content approximately every 4 hours, so you are willing to allow the WebAccelerator system to serve content that is 8 hours old (or twice the age of the content), if the origin web servers are not responding to the WebAccelerator systems refresh requests. For the search applications that change more frequently, you want the stand-in period to be 2 hours longer than the caches TTL value.
Create a lifetime rule with a stand-in period of 8 hours and a maximum age of 24 hours, for the WebAccelerator system cache options. Provide no other life time rule settings, so the home page is cached for the maximum amount of time allowed by the WebAccelerator system.
Create a lifetime rule with a stand-in period of 8 hours, and a maximum age of 24 hours, for the WebAccelerator system cache options. Set the client cache setting at 4 hours. Provide no other lifetime rule settings, so that the images page is cached for the maximum amount of time allowed by the WebAccelerator system.
Create a lifetime rule with a maximum cache time of 5 hours and a stand-in period of 8 hours, for the WebAccelerator system cache options.
Create a lifetime rule with HTTP headers support enabled for the content lifetime option. Also, set the WebAccelerator system cache settings at a maximum age of 8 hours and a stand-in period of 10 hours.
The following procedures describe how to create the lifetime rules for the Default and Search nodes. Follow the same procedure to create the lifetime rules for the Home and Image nodes.
1.
On the Main tab of the navigation pane, expand WebAccelerator and click Applications.
The Applications screen opens in a new window.
2.
On the Main tab of the navigation pane in the new window, click Policies.
The Policies screen opens, displaying a table of user-defined and pre-defined acceleration policies.
3.
On the User-defined Acceleration Policies table, click the name of the acceleration policy that you want to edit.
The Policy Editor screen opens.
5.
From the Matching Rules list on the Policy Editor menu bar, select Acceleration Rules.
The acceleration rules display on the Policy Editor menu bar.
6.
On the Policy Editor menu bar, click Lifetime.
The Lifetime Rules screen opens.
7.
Clear the check box for Obey ESI max age if present.
8.
Clear the check box for Use HTTP lifetime headers if present.
a)
For Maximum Age, type 24 in the box and select Hours from the list.
b)
For Stand-in Period, type 8 in the box and select Hours from the list.
10.
Click the Save button.
1.
On the Main tab of the navigation pane, expand WebAccelerator and click Applications.
The Applications screen opens in a new window.
2.
On the Main tab of the navigation pane in the new window, click Policies.
The Policies screen opens, displaying a table of user-defined and pre-defined acceleration policies.
3.
On the User-defined Acceleration Policies table, click the name of the acceleration policy that you want to edit.
The Policy Editor screen opens.
5.
From the Matching Rules list on the Policy Editor menu bar, select Acceleration Rules.
The acceleration rules display on the Policy Editor menu bar.
6.
On the Policy Editor menu bar, click Lifetime.
The Lifetime Rules screen opens.
7.
Clear the check box for Obey ESI max age if present.
8.
Clear the check box for Use HTTP lifetime headers if present.
9.
In the Client Cache Settings area, select Maximum Age.
The Maximum Age options display.
10.
In the Maximum Age, type 4 in the box, and select Days from the associated list.
a)
For Maximum Age, type 5 in the box, and select Hours from the list.
b)
For Stand-in Period, type 8 in the box, and select Hours from the list.
12.
Click the Save button.
1.
On the Main tab of the navigation pane, expand WebAccelerator and click Applications.
The Applications screen opens in a new window.
2.
On the Main tab of the navigation pane in the new window, click Policies.
The Policies screen opens, displaying a table of user-defined and pre-defined acceleration policies.
3.
On the User-defined Acceleration Policies table, click the name of the acceleration policy that you want to edit.
The Policy Editor screen opens.
5.
From the Matching Rules list on the Policy Editor menu bar, select Acceleration Rules.
The acceleration rules display on the Policy Editor menu bar.
6.
On the Policy Editor menu bar, click Lifetime.
The Lifetime Rules screen opens.
7.
Clear the check box for Obey ESI max age if present.
8.
Clear the check box for Use HTTP lifetime headers if present.
a)
For Maximum Age, type 5 in the box, and select Hours from the list.
b)
For Stand-in Period, type 8 in the box, and select Hours from the list.
10.
Click the Save button.
2.
From the Matching Rules list on the Policy Editor menu bar, select Acceleration Rules.
The acceleration rules display on the Policy Editor menu bar.
4.
Clear the check box for Obey ESI max age if present.
5.
Clear the check boxes for Ignore no-cache HTTP headers in the request and Ignore no-cache HTTP headers in the response.
a)
For Maximum Age, type 8 in the box, and select Hours from the list.
b)
For Stand-in Period, type 2 in the box, and select Hours from the list.
7.
Click the Save button.

Was this resource helpful in solving your issue?




NOTE: Please do not provide personal information.



Incorrect answer. Please try again: Please enter the words to the right: Please enter the numbers you hear:

Additional Comments (optional)