ltm rule command CACHE userkeyΒΆ

iRule(1)					  BIG-IP TMSH Manual					     iRule(1)

CACHE::userkey
       Allows users to add user-defined values to the key used by the cache to reference the cached content.

SYNOPSIS
       CACHE::userkey KEY

DESCRIPTION
       By default, cached content is stored with a unique key referring to both the URI of the resource to be cached
       and the User-Agent for which it was formatted. If multiple variations of the same content must be cached under
       specific conditions (different client), you can use this command to create a unique key, thus creating cached
       content specific to that condition. This can be used to prevent one user or group's cached data from being
       served to different users/groups.  For example, you can use this command to store different cached content for
       dialup and broadband by using the MTU as a user-defined value or to cache different sets of content for
       internal and external clients.

       CACHE::userkey 

	    * Allows to add user-defined values to the key, according to
	      the specified key string.

RETURN VALUE
VALID DURING
       HTTP_REQUEST, HTTP_REQUEST_DATA

EXAMPLES
	Create a separate cache entry for internal and external clients,
	useful when server generates different documents internal and external requests

	when HTTP_REQUEST {
	  if {[matchclass [IP::client_addr] equals $::InternalIPs]} {
	    CACHE::userkey "Internal"
	  } else {
	    CACHE::userkey "External"
	  }
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-9.2.0 --First introduced the command.

BIG-IP						      2020-06-23					     iRule(1)