Web Cache rule set

The Web Cache rule set is a library rule set for web caching.

Library rule set – Web Cache
Criteria – Always
Cycles – Requests (and IM), Responses

The following rule sets are nested in this rule set:

  • Read from Cache
  • Write to Cache

Read from Cache

This nested rule set enables the reading of web objects from the cache and forbids it for URLs that are on a bypassing list.

Nested library rule set – Read from Cache
Criteria – Always
Cycles – Requests (and IM)

The rule set contains the following rules.

Skip caching URLs that are in Web Cache URL Bypass List
URL matches in list Web Cache URL Bypass List –> Stop Rule Set
The rule uses the URL property to check for requested URLs whether they are on the specified bypass list.
If they are, processing of the rule set stops. The rule that enables reading from the cache is then not processed.
Processing continues with the next rule set.
Enable Web Cache
Always –> Continue — Enable Web Cache
The rule is always processed unless it is skipped because the bypassing rule placed before it in the rule set applies. It enables the web cache, so objects stored in it can be read.
Processing continues with the next rule set.

Write to Cache

This nested rule set enables the writing of web objects to the cache and forbids it for large objects, as well as for URLs and media types on particular bypassing lists.

Nested library rule set – Write to Cache
Criteria – Always
Cycles – Responses

The rule set contains the following rules.

Skip caching URLs that are in Web Cache URL Bypass List
URL matches in list Web Cache URL Bypass List –> Stop Rule Set
The rule uses the URL property to check for requested URLs whether they are on the specified bypass list.
If they are, processing of the rule set stops. The rule that enables reading from the cache is then not processed.
Processing continues with the next rule set.
Skip caching objects that are larger than x bytes
StringToNumber(Header.Response.Get("Content-Length") greater than 8388608 –> Stop Rule Set
The rule uses the StringToNumber property, which takes the Header.Response.Get property as a parameter to find out what the size of a given web object in bytes is.
The web object is the one that is sent in response to a request to Web Gateway. Its size in bytes is submitted in the Content-Length part of the header that is sent with the body of the object.
This part is configured as a parameter of the Header.Response.Get property, which lets the object size be retrieved as value of this property. The StringToNumber property is used to convert the header part that contains the size in string format into a numerical value.
If the number of bytes found in this way exceeds the number that is configured as the value of the operand, processing of the rule set stops. The rule that enables reading from the cache is then not processed.
Processing continues with the next rule set.
The rule is not enabled by default.
Skip caching media types that are in Web Cache Media Type Bypass List
URL matches in list Web Cache Media Type Bypass List –> Stop Rule Set
The rule uses the URL property to check for requested URLs whether they are on the specified bypass list.
If they are, processing of the rule set stops. The rule that enables reading from the cache is then not processed.
Processing continues with the next rule set.
Enable Web Cache
Always –> Continue — Enable Web Cache
The rule is always processed unless it is skipped because the bypassing rule placed before it in the rule set applies. It enables the web cache, so objects stored in it can be read.
Processing continues with the next rule set.