What this iRule does?

Hi,

Would like to know what the following iRule accomplish.

when HTTP_RESPONSE {

HTTP::header replace Pragma public

HTTP::header replace Cache-Control public

}

Srini

Those commands inject/replace the Pragma and Cache-Control headers in the HTTP response to the client, effectively replacing whatever cache controls are being sent by the server (if any). The ‘public’ designation tells the client browser (and in-path proxies) that the page may be cached.

Thanks Kevin. So this effectively tells client browser not to cache?

Quite the opposite. It replaces the header values so that ALL content is cached by proxys, caches and client browsers; regardless of what the origin server has specified.

Thanks Steve. That clears the air.

I’d only use that iRule on a virtual server that load balances web servers that only serve static content. You’re asking for trouble if there’s any user-specific content that you’re forcing caching on.

Aaron