F5 Big-IP caching through iRule

525 Views Asked by At

Have a iRule that forces uri's into the cache.

when HTTP_REQUEST {
 if { [HTTP::header "Content-Type"] contains "jpg" } {
    CACHE::enable 

 }
}

Seems this item will be cached forever or until the cache is forcibly emptied. Is there a way we can add an expiry to these items?

1

There are 1 best solutions below

0
On

Based on info at https://clouddocs.f5.com/api/irules/UsingIRulesToManipulateCache.html I guess you can do something like:

when CACHE_REQUEST {
  if { [HTTP::header "Content-Type"] contains "jpg" && [CACHE::age] > 60 } {
    CACHE::expire
  }
}