Version notice:
CACHE_RESPONSE¶
Description¶
Triggered immediately prior to sending a cache response. Used to
override default behavior.
Examples¶
when CACHE_RESPONSE {
if { $expired == 1 } {
CACHE::expire
log local0. "cache expire"
set expired 0
}
}
Related Information¶
Available Commands:
- CACHE::header - Get the content of an Header related to an object stored in the RamCache.
- CACHE::headers - Returns the HTTP headers of the cache response.
- CACHE::payload - Returns the HTTP payload of the cache response.
- CACHE::trace - Dump the list of cached objects for a HTTP profile where RAM cache is enabled.
- clone - Causes the system to clone traffic to the specified pool or pool member regardless of monitor status.
- forward - Sets the connection to forward IP packets.
- HTTP::close - Closes the HTTP connection.
- HTTP::collect - Collects an amount of HTTP body data that you specify.
- HTTP::cookie - Queries for or manipulates cookies in HTTP requests and responses.
- HTTP::fallback - Specifies or overrides a fallback host specified in the HTTP profile.
- HTTP::header - Queries or modifies HTTP headers.
- HTTP::host - Returns the value of the HTTP Host header
- HTTP::is_keepalive - Returns a true value if this is a Keep-Alive connection.
- HTTP::is_redirect - Returns a true value if the response is a redirect.
- HTTP::password - Returns the password part of HTTP basic authentication.
- HTTP::payload - Queries for or manipulates HTTP payload information.
- HTTP::redirect - Redirects an HTTP request or response to the specified URL.
- HTTP::request_num - Returns the number of HTTP requests that a client made on the connection.
- HTTP::respond - Generates a response to the client as if it came from the server.
- HTTP::uri - Returns or sets the URI part of the HTTP request.
- HTTP::username - Returns the username part of HTTP basic authentication.
- HTTP::version - Returns or sets the HTTP version of the request or response.
- imid - Returns an i-mode identifier string.
- IP::idle_timeout - Returns or sets the idle timeout value.
- ip_ttl - Returns the TTL of the latest IP packet received.
- lasthop - Sets the lasthop of an IP connection.
- listen - Sets up a related ephemeral listener to allow an incoming related connection to be established.
- nexthop - Sets the nexthop of an IP connection.
- node - Sends the packet directly to the identified server node.
- peer - Causes the specified iRule commands to be evaluated under the peer’s (opposite) context.
- persist - Causes the system to use the named persistence type to persist the connection.
- session - Utilizes the persistence table to store arbitrary information based on the same keys as persistence.
- SSL::cert - Returns X509 SSL certificate data.
Warning
The links to the sample code below are remnants of the old DevCentral wiki and will result in a 404 error. For best results, please copy the link text and search the codeshare directly on DevCentral.
Sample Code:
- Introduced: BIGIP-9.0.5
The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.