vADC Forum

Reply
Occasional Contributor
Posts: 7
Registered: ‎05-16-2016
Accepted Solution

Traffic Manager cache bypass

Hi,

 

I've cache enabled on my Virtual Server that works fine and I have a particular html page in the cache. If a client arrives from a particular IP or Cookie, I want to bypass the cache to go directly to the backend pool (I don't want to disable cache).

 

Is it possible ? If yes, how to do that ?

 

Regards.

 

Brocadian
Posts: 13
Registered: ‎07-07-2016

Re: Traffic Manager cache bypass

Hi ops_mdm,

 

Maybe the following TS could do the trick:

 

$remote_ip = request.getremoteip();
if (http.cache.exists() && string.IPMaskMatch( $remote_ip, "10.0.0.0/16" )) {
  pool.use(...)
}

Baptiste

Occasional Contributor
Posts: 7
Registered: ‎05-16-2016

Re: Traffic Manager cache bypass

Hi Baptiste,

 

It doesn't works. pool.use or pool.select don't stop the rules processing and cache access (apparently).

 

Regards.

Highlighted
Brocadian
Posts: 103
Registered: ‎04-22-2015

Re: Traffic Manager cache bypass

[ Edited ]

Hello, there are a few articles on the community about cache management, I have reposted them here for information:

http://community.brocade.com/t5/vADC-Docs/Feature-Brief-Stingray-Content-Caching/ta-p/73625

http://community.brocade.com/t5/vADC-Blog/Content-caching-for-dynamic-web-applications-with-Stingray/ba-p/73576

 

Of course, yoiu could attempt to enable/disable the cache each time but that might impact other users. 

 

One method you could use to force a page to bypass the cache would be to add a "no-cache" header to the current request; note that this would bypass the cache, send the request to the servers, and would update the cache on the response:

 

 
If (condition) {
   http.addHeader( "Cache-Control", "no-cache" );
}
 
Alternatively, you could create a "non-cached" virtual server: Create a new virtual server which responds to the non-cached version, say, "nocache.mydomain.com" and include any processing rules you want in the non-cached version. Then in the original virtual server, trap the special requests and redirect to the new service. 
 
If (condition) {
http.redirect( "http://nocache.mydomain.com" );
}
 
http.redirect() issues a response code 302 to redirect to the non-cached service, which then bypass the cache in the main service, and give complete control over what happens in the non-cached service.
 
 
 

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.