Forum Discussion

funkdaddy_31014's avatar
funkdaddy_31014
Icon for Nimbostratus rankNimbostratus
Jan 06, 2011

Can't remove Pragma header

Having some content caching issues with a client and I'd like to remove the Pragma header in the event that it's messing things up. I have tried the following:

 

 

when HTTP_RESPONSE {

 

log local0. "BEFORE HEADER: Pragma: [HTTP::header Pragma]"

 

HTTP::header remove "Pragma"

 

log local0. "AFTER HEADER: Pragma: [HTTP::header Pragma]"

 

}

 

 

But this always ends up with "Pragma: no-cache"

 

 

Jan 6 14:14:07 tmm tmm[2083]: Rule pragma_test : BEFORE HEADER: Pragma: no-cache

 

Jan 6 14:14:07 tmm tmm[2083]: Rule pragma_test : AFTER HEADER: Pragma: no-cache

 

 

Replacing the Pragma header works:

 

 

when HTTP_RESPONSE {

 

log local0. "BEFORE HEADER: Pragma: [HTTP::header Pragma]"

 

HTTP::header replace "Pragma" "foo"

 

log local0. "AFTER HEADER: Pragma: [HTTP::header Pragma]"

 

}

 

 

Ends up with "Pragma: foo" in the Response Headers.

 

 

Jan 6 14:28:10 tmm tmm[2083]: Rule pragma_test : BEFORE HEADER: Pragma: no-cache

 

Jan 6 14:28:10 tmm tmm[2083]: Rule pragma_test : AFTER HEADER: Pragma: foo

 

 

Any ideas?

 

  • Hi,

     

     

    Why not use:

     

     

    HTTP::header replace "Pragma" ""

     

     

    This way you remove header!

     

     

    Regards,
  • Besides logging, have you done a packet capture to see whether the header is indeed being sent? Just curious whether the logging is correct as I'd expect the header to be removed.
  • Thanks for the replies. Indeed I have done a packet capture and the Pragma is not being removed. Replacing with "" works but I was more concerned with understanding why remove doesen't work...

     

  • Hi Funkdaddy,

     

     

    Do you have any modules/features enabled on the virtual server like WAM or RAM cache? If so, they might be affecting Pragma header. Regardless, it would be a good idea to open a case on the issue with F5 Support so they can review your full configuration and logs.

     

     

    Aaron