Disable caching for some hosts

Hello all,

I have a web server hosting many websites. Let’s say :

www.gb.foo.com

www.es.foo.com

www.us.foo.com

www.fr.foo.com

etc…

Some of these virtual hosts on the web server are cached by an external provider (akamai), but not all. I have on my bigip (v9.4.1) a virtual server, with ramcache enabled, but I want to disable caching for the hosts already cached by Akamai (<10).

I’m thinking to create an irule like this (as URI exclusion will not work in the cache configuration of the virtual server) :

when HTTP_REQUEST {

switch [HTTP::host] {

“www.gb.foo.com” { CACHE:disable }

“www.es.foo.com” { CACHE:disable }

“www.us.foo.com” { CACHE:disable }

}

}

Will it work ?

Do you have suggestions for a smarter way ?

Thanks !

--

CS

Thanks Colin,

I applied it in production today, it works.

(There was a mistake in my copy/paste, it’s not CACHE:disable but CACHE::disable).

Thanks