Forum Discussion
Matthew_Goche_6
Nimbostratus
Feb 22, 2007Problems encouraging caching on the browser
We are a web-hosting site and we have an iRule setup to encourage caching on the client browsers. However, a lot of URIs that meet the iRule arguments are not being cached by clients running IE6.0. ...
Harold_Deadman_
Nimbostratus
Feb 22, 2007This is the rest of the i-rule that is actually telling the browser to cache stuff. We are removing the Etag because it isn't adding any value over last-modified date and our two IIS servers are returning different Etag values for the same file (because their config's aren't in sync).
Internet Explorer doesn't seem to want to cache anything with a Vary header in it. We haven't tried stripping that out yet, not sure if we can since I think it is being added by the HTTP profile because we have caching and compression on. I don't want the Vary header because we are already telling proxies that the content is private so intermediary caches won't cache it.
when HTTP_RESPONSE priority 900 {
if { (not([HTTP::header exists "Cache-control"])) and (not([HTTP::header exists "Content-Disposition"])) } {
if {not($cachetime == 0)} {
HTTP::header remove "Etag"
HTTP::header remove "X-Powered-By"
HTTP::header insert Cache-Control "private,max-age=$cachetime,post-check=$::postcheck,pre-check=$cachetime,must-revalidate,proxy-revalidate"
HTTP::header replace Expires [clock format [expr ([clock seconds]+$cachetime)] -gmt true -format "%a, %d %b %Y %T %Z"]
} else {
log local0. "Cache time is zero: [HTTP::path]"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
