Forum Discussion

Re: Instructing BigIP to expire RAM Cache when it receives a URL Query

Hi David,

Can you try this without the redirect? Also, you can parse the URI without the query string using HTTP::path. To get just the query string you can use HTTP::query.

when HTTP_REQUEST {
 Disable cache for a defined set of folders
if { [class match [HTTP::uri] contains folders_to_not_cache] }{
CACHE::disable
return
}

if { [string tolower [HTTP::query]] starts_with "expire" } {
log "Request to expire [HTTP::path] received."
set expire_cache_trigger 1

 Remove the query string from the URI
HTTP::uri [HTTP::path]
}
}

when CACHE_REQUEST {
if { ( [info exists expire_cache_trigger] ) && ( $expire_cache_trigger==1 ) } {
CACHE::expire
log "Cache Expired"
unset expire_cache_trigger
}
}

Aaron
No RepliesBe the first to reply