有一个强制 uri 进入缓存的 iRule。
when HTTP_REQUEST {
if { [HTTP::header "Content-Type"] contains "jpg" } {
CACHE::enable
}
}
似乎该项目将被永久缓存或直到缓存被强制清空。有没有办法可以为这些项目添加有效期?
根据https://clouddocs.f5.com/api/irules/UsingIRulesToManipulateCache.html上的信息,我猜您可以执行以下操作:
when CACHE_REQUEST {
if { [HTTP::header "Content-Type"] contains "jpg" && [CACHE::age] > 60 } {
CACHE::expire
}
}