Forum Discussion
CharlieMoad_142
Mar 04, 2014Nimbostratus
Bypass caching when a cookie matching a pattern is present
We have created an iRule which should disable caching for any request containing a cookie matching a pattern (starting with SESS). It seems like all the rules we have tried have no effect. When cachi...
IheartF5_45022
Mar 05, 2014Nacreous
The CACHE::disable command should work from HTTP_REQUEST to prevent the response being returned from cache, however to make doubly sure, try setting it from HTTP_RESPONSE as well (to ensure your response doesn't get cached). Also add in some debugging statements;-
when CACHE_REQUEST {
log local0. "[HTTP::uri]"
}
when HTTP_REQUEST {
set fDisable 0
set c_cookies [HTTP::cookie names]
set uri [HTTP::uri]
if {[lsearch -regexp $c_cookies "SESS*"]} {
set fDisable 1
CACHE::disable
}
}
CACHE_RESPONSE {
when CACHE_REQUEST {
log local0. "[HTTP::uri]"
}
}
when HTTP_RESPONSE {
if {$fDisable} {
CACHE::disable
}
}
Hopefully this helps solve your problem.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects