CACHE::trace

Description

Dump the list of cached objects for a HTTP profile where RAM cache is enabled.
This event will execute only if a RAM cache profile is enabled on the Virtual Server, and for objects that match the RAM cache configuration. The list will represent the size of the cache (Cache Size), number of objects (Cache Count), and starting by the term Entity, it will list every object:
  • Pos (0001), list the position of the object in the cache
  • Local Hits (00031/00007) indicate the number of Local Hits
  • Remote Hits (00031/00007) indicate the number of Remote Hits
  • Served (000) list the number of times the object was served from the cache
  • Age (1931), indicate the aging of the object in the cache
  • Score (0124), indicate the scoring of the object
  • Key - ‘www.mystestsite.fr/f5-logo.gif’ list the name of the object

Syntax

CACHE::trace

Examples

when RULE_INIT {
set static::cache ""
}
when HTTP_REQUEST {
if { [HTTP::uri] ends_with "/cache" } {
    HTTP::respond 200 content "CACHE DUMP\r\n\r\n$static::cache\r\n\r\n"
}
}

when CACHE_RESPONSE {
   CACHE::header insert X-Via F5-LB
   set static::cache [CACHE::trace]
}

Page Returned (in TEXT format):
CACHE DUMP

Cache size         - 1414
Cache count        - 1
  Entity - Pos (0001) Local Hits (00000/00000) Remote Hits (00000/00000) Served (005) Age (005) Score (0000) Key - '10.100.30.111/templates/divers/icone.gif'