SGOS can identify the compression method of a response object
(retrieved from an Origin-Content-Server) and can store up to 3 variants of the object.
The 3 variants are: gzip, deflate, and identity (which means there is no compression being used).
If the Origin-Content-Server (OCS) returns a gzipped object, and it's cachable, it will be stored
in cache. If a client requests a variant of a previously cached object, the SG will first check
if the variant is already cached. If not, default behavior is to re-fetch the object and store the
retrieved object in cache. Depending on your client requests, it's possible for each cachable
object to be fetched up to 3 times.
Sometimes the default re-fetching behavior of variant objects is undesirable.
Via Content Policy Language (CPL) this default behavior can be altered so the SG will only fetch
the object once from the OCS, and if a client requests a variant of an object that is already
cached- the SG will provide the client with the correct encoding "on the fly" without re-fetching
from the OCS.
To enable this behavior instead of the default, apply the following CPL using either the VPM or
within a policy file:
- Open VPM, add a NEW Web Content Layer (do not add a rule to an existing layer)
- Set the Action column to a new "Set Client HTTP Compression" object
- When the dialog box appears, the radio buttons will already be set properly
Just click OK.
- Install this new policy
Via CPL in a Policy-file:
-Add both a <Cache> layer-tag and this rule (as shown):
With this policy in place, the SG will automatically provide the correct variant of a cached object
to a client without re-fetching it from the OCS.