Forum Discussion
Gerardo_Garcia_
Nimbostratus
Nov 18, 2009SharePoint Caching imgs, js, css
I need you help with an iRule
I need to add a header that will allow the cache of all the content type
application/javascript
image/gif
text/css
image/jpg
that includes in the URL
_layouts
_themes
The way that I think we need to do it is to create an iRule that will allow me to insert a header based on the content type and the URL.
The header that I need to insert is the
Expires:12/31/2035
Cache-Control:public
Can you help me with the iRule?
- The_Bhattman
Nimbostratus
Hi Gerardo,when HTTP_RESPONSE { if { ![HTTP::header exists Cache-Control] and ![HTTP::header exists Expires] and [HTTP::header exists Content-Type] } { switch -glob [HTTP::header Content-Type] { "application/javascript" - "image/gif" - "text/css"- "image/jpg" { HTTP::header insert "Expires" "12/31/2035" HTTP::header insert "Cache-Control" "public" } } } }
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