ltm rule command CACHE priorityΒΆ

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



CACHE::priority
       Adds a priority to cached documents.

SYNOPSIS
       CACHE::priority CACHE_PRIORITY

DESCRIPTION
       Assigns a priority to cached documents. The priority value can be
       between 1 and 10 inclusive. This command allows users to designate
       documents that are costly to produce as being more important than
       others to cache. This is particularly useful when you have a document
       that is not requested often, but is expensive to produce (such as a
       server-compressed document.) By increasing the priority, you are
       increasing its likelihood of being served from the cache

       The default priority value for entries in the cache is zero (0 = cache
       priority disabled).

       CACHE::priority <1 .. 10>

	    * Assigns a priority to the currently requested cached document. The
	      priority value can be between 1 and 10 inclusive.

RETURN VALUE
VALID DURING
       HTTP_REQUEST, HTTP_REQUEST_DATA

EXAMPLES
	when HTTP_REQUEST {
	  switch -glob [HTTP::uri] {
	    "*.zip" -
	    "*.tar" -
	    "*.gz" {
	      # set the priority to 8 for this document if it's a compressed archive
	      CACHE::priority 8
	    }
	    "*.gif" -
	    "*.jpg" -
	    "*.png" {
	      # set the priority to 5 for this document if it's an image
	      CACHE::priority 5
	    }
	    "/mustcache*" {
	      # Any document matching /mustcache will be set to the highest priority.
	      CACHE::priority 10
	    }
	  }
	}

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



BIG-IP				  2017-01-31			      iRule(1)