Forum Discussion

Moinul_Rony's avatar
Moinul_Rony
Icon for Altostratus rankAltostratus
Aug 27, 2013

How to ad Cache-Control: no-store and Pragma: no-cache included in the http header for all pages

Hi, to prevent secure pages to store in disk can we use the following iRule to set

 

Cache-Control: no-store

 

Pragma: no-cache

 

when HTTP_RESPONSE {

 

HTTP::header insert Cache-Control "no-store, no-cache"

 

HTTP::header insert Pragma "no-cache"

 

}

 

  • the irule looks okay to me. anyway, there is another example in the following articles.

     

    iRule: prevent caching on certain file types by Joe Pruitt

     

    https://devcentral.f5.com/articles/irule-prevent-caching-on-certain-file-types.Uh1Dlj_4uCQ

     

    Using iRules To Manipulate Cache

     

    https://devcentral.f5.com/wiki/iRules.UsingIRulesToManipulateCache.ashx

     

  • Semantic probably, but I'd use HTTP::header replace here in case a conflicting cache control header already exists in the response.

     

  • I am wondering if "replace" create a dependency on what webserver respond with?