Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

no-cache irule

Michael_Mangret
Nimbostratus
Nimbostratus
All,

 

 

I am trying to include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE to the http response from my LTM. Does anyone know how to get me started in writing something like this into an irule? I have found the following information at devcentral. http://devcentral.f5.com/wiki/default.aspx/iRules.CACHE, not sure if any of this is going to help me accomplish my task. I have also search the irule forum with no success.

 

 

Please advise,

 

 

Mike
3 REPLIES 3

Joe_Pruitt
Cirrostratus
Cirrostratus
It's as simple as adding headers in the response

when HTTP_RESPONSE {
  HTTP::header insert "PRAGMA" "NO-CACHE"
  HTTP::header insert "CACHE-CONTROL" "NO-CACHE"
}

For more help with the HTTP::header commands, take a look at the iRules wiki where we document all the methods.

-Joe

Chad_Roberts_21
Nimbostratus
Nimbostratus
I have this exact rule applied to one of our apps (and I've tried adding HTTP::version "1.1" as well), and it works great for the most part... until a user attempts to download a file in IE. I've found a number of sites that talk about problems when downloading files in IE when the CACHE-CONTROL header is present, but I find it hard to believe that this long into the existence of IE it's still just a fact that IE, downloads, and that header cannot ever co-exist. Has anyone else ever run into this?

 

 

When a user attempts to download a file, the error is something like this:

 

 

Internet Explorer cannot download [file] from [server host name].

 

 

Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

 

 

Any ideas?

Hi Chad,

 

I amnew to this F5.  I am trying to do the same thing like you adding no cache on the header.  would you mind sharing the iRule that you did for this.

Thank you

Hanny