Forum Discussion

Jay_Sawyer_1110's avatar
Jay_Sawyer_1110
Icon for Nimbostratus rankNimbostratus
Mar 16, 2007

Vary Header element replacement or removal

Hello all...

 

 

I have a virtual server with an HTTP profile with compression enabled with selective. I am using the following iRule:

 

 

when HTTP_RESPONSE {

 

foreach header {Vary} {

 

while { [HTTP::header exists $header] } {

 

HTTP::header remove $header

 

}

 

}

 

}

 

 

 

When attempting to remove the vary header in the response to either replace elements or remove the vary altogether, it seems to always show up in the response. Am I presuming that the LTM does not allow the Vary header to be removed/touched by an iRule considering there's a global option to disable it int he profile.

 

 

Disabling the vary header globally is not optimal to stay compliant with RFC2616, but I would like to be able to remove or replace this header for specific responses. Is there a better way of doing this short of disabling Vary within the profile?

 

 

This request stems from the MS IE6 issue when seeing the Vary header when attempting to open an Excel file. I am currently working with F5 Technical Support and have not been provided a solution/workaround as of yet.

 

 

Thank you for your time gents,

 

Jay Sawyer
  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    Jay, do you have compression or ramcache enabled? Then that's probably why its being re-added.

     

     

    I have heard of similar problems before and unfortunately there is no rule work around if you hame those features enabled. Your best bet is to continue to work with support. Sorry!
  • Thanks for reply...

     

     

    Yes, I do have compression enabled and can disable the Vary header via HTTP profile, but customer does not want to disable Vary for everyone.

     

     

    I know that the iRule above will not work since it processes the response before the profile.

     

     

    So, my only other idea is to either find a way to switch profiles or do some funky virtual server redirect.
  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    If you don't have ramcache then there is another work around you coud try. There is a profile option in the http profile that allows you to disable adding the vary header. You could disable that and manually hand roll the header insertion in the rule.

     

     

    In any case, not adding vary headers can be really damaging especially when there are down stream caches in your network or others (does not matter).