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. A specific URI that we are having trouble with is:
/imageserver/plumtree/common/private/js/jsutil/LATEST/PTUtil.js
Please let me know is there are any other considerations for this work. Some smaller files seem to be cached, but I know my cache limit is not the problem. Please let me know if you have any ideas.
The iRule is:
when HTTP_REQUEST priority 50 {
set cachetime 0
if {not ([HTTP::version] equals "1.1")} {
HTTP::header insert "x-httpversion" [HTTP::version]
log local0. "Access via [HTTP::version]"
}
switch -glob [string tolower [HTTP::path]] {
"/imageserver/plumtree/common/*" -
"/imageserver/plumtree/portal/private/*" -
"/imageserver/plumtree/portal/public/*" {
set cachetime $::twoweeks
}
"/imageserver/plumtree/portal/custom/*" {
set cachetime $::workday
}
"/imageserver/plumtree/portal/*" -
"/documents/*" {
set cachetime $::day
}
"/portal/server.pt/gateway/*.gif" -
"/portal/server.pt/gateway/*.css" -
"/portal/server.pt/gateway/*.js" -
"/portal/server.pt/gateway/*.jpg" -
"/portal/server.pt/gateway/*.png" {
set cachetime $::workday
}
"*.gif" -
"*.jpg" -
"*.png" {
set cachetime $::workday
}
"*.css" -
"*.js" {
set cachetime $::workday
}
default {
set cachetime 0
}
}
if {not($cachetime == 0)} {
HTTP::header remove "If-None-Match"
}
log local0. "URI is [HTTP::path], Cache time: $cachetime"
}
- Harold_Deadman_
Nimbostratus
This 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). - spark_86682Historic F5 AccountThere's a fascinating post on MSIE 4.x, 5.x, and 6.x behavior with regards to compression, caching, and HTTP headers at http://lists.over.net/pipermail/mod_gzip/2002-December/006826.html (Click here). MSIE 7 is a whole other ball of wax, of course, and I won't claim to know all those corner cases.
- Matthew_Goche_6
Nimbostratus
We have added the following into our iRule: - bl0ndie_127134Historic F5 AccountOk lets try a bigger hack then. Can you modify your rule to add a 'Vary" User-Agent' header? I wonder if we can trick IE to look the first instance of the header (you never know).
- Matthew_Goche_6
Nimbostratus
We are still having trouble removing the Vary header via an iRule. I tried deleting it and then reinserting just what I want: - Jay_Sawyer_1110
Nimbostratus
Posted By mgoche on 02/23/2007 12:30 PM
- Atou
Nimbostratus
Don't know if this is answered in the meantime but you need also add the removal of the "Vary" header in the event CACHE_RESPONSE.
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