For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

neeeewbie's avatar
Mar 29, 2024
Solved

CACHE::disable iRule doesn't seem to be working.

Hi guys 

I need help ! 

 

Our customer wants to disable caching for GET requests, but the CACHE::disable iRule doesn't seem to be working. Do you have any suggestions?

 

thank you

  • thanks for your information 

    but below irule does not work,, f5 device can not send traffic to server after applied below irule

    idk the reason

     

    when HTTP_REQUEST priority 500 {

         if { [HTTP::header exist "Content-Type"] }  {
            if { [HTTP::header exist "Cookie"]  } { 
                CACHE::disable
                }
            CACHE::enable
            }        
    }

    when HTTP_RESPONSE priority 600 {

       if { [HTTP::status] == 200 }{
               if { [HTTP::header exist "Cookie"] } { 
                CACHE::disable
          }
          CACHE::enable
        }
    }

     

3 Replies

  • Hi neeeewbie

    I think this iRule will do.

    when HTTP_REQUEST priority 500 {
        if { [HTTP::method] equals "GET" } {
            CACHE::disable
        } else {
            CACHE::enable
        }
    }

    KR
    Daniel

  • thanks for your information 

    but below irule does not work,, f5 device can not send traffic to server after applied below irule

    idk the reason

     

    when HTTP_REQUEST priority 500 {

         if { [HTTP::header exist "Content-Type"] }  {
            if { [HTTP::header exist "Cookie"]  } { 
                CACHE::disable
                }
            CACHE::enable
            }        
    }

    when HTTP_RESPONSE priority 600 {

       if { [HTTP::status] == 200 }{
               if { [HTTP::header exist "Cookie"] } { 
                CACHE::disable
          }
          CACHE::enable
        }
    }