DevCentral Groups
   
You are here: Community > Group Details > iRules

Get Connected with DevCentral

Sign up and Join this Group today!

Connect with your peers with the click of a button. Become a member of this group to post questions, sign up for notifications, provide comments, answer questions, access downloads and receive lots of other great documentation relevant to your interests. Connect with your community today!

  

Group Details

iRules

F5 DevCentral Topic Group dedicated to open discussion and collaboration related to F5's unique and incredibly powerful iRules scripting language.
iRules
Upcoming Events
There are no events currently connected to this group. Click here to search all F5 Events.

Having trouble posting to this forum? Click the "Join Group" button above to get access!

HTTP Profile :: Vary Header Help
Last Post 10/08/2009 05:33 PM by spark. 5 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
Please login or join DevCentral to post a reply.
 
PrevPrev NextNext
Author Messages
adalan
adalan
Post Count: 14
Active Member


--
08/17/2009 06:13 AM  
Not sure if this is the correct place for this, but I'm noticing what I would consider and abnormality in the way the VARY header is working. It seems to be adding a User-Agent component the vary header which I would like to remove:
With "vary header" checked under compression on HTTP profile:
----------------------------------------------------------
HTTP/1.x 200 OK
Date: Mon, 17 Aug 2009 13:06:39 GMT
Edge-control: !no-store
Content-Type: text/html
Expires: Tue, 18 Aug 2009 13:06:38 GMT
Cache-Control: max-age=86400,private
Vary: Accept-Encoding, User-Agent
Content-Encoding: gzip
Connection: close
----------------------------------------------------------
With "vary header" unchecked under compression on HTTP profile:
----------------------------------------------------------
HTTP/1.x 200 OK
Date: Mon, 17 Aug 2009 13:08:04 GMT
Edge-control: !no-store
Content-Type: text/html
Expires: Tue, 18 Aug 2009 13:08:04 GMT
Cache-Control: max-age=86400,private
Content-Encoding: gzip
Connection: close
----------------------------------------------------------

Is there a way to remove just the User-Agent portion?
hoolio
hoolio
Post Count: 11053
MVP - 9


--
08/17/2009 09:10 AM  
I'm not too familiar with the Vary header and whether there is a good way to address this in the configuration. But if you want to remove everything including and after the first comma, you could use scan:

# scan everything not a comma into precomma and the rest into ignore
scan [HTTP::header Vary] {%[^,]%s} precomma ignore

# Update the Vary header value with the scan output
HTTP::header replace Vary $precomma

Else, getfield would allow you to do this without the intermediate variables:

# Update the Vary header value with first field of the Vary header value, delimited by commas
HTTP::header replace Vary [getfield [HTTP::header Vary] "," 1]

Aaron
adalan
adalan
Post Count: 14
Active Member


--
08/17/2009 10:20 AM  
It seems like a lot of processing, I'd think there would be some setting to change the vary header that it's sending out. I just can't find it.
Denny Payne
Denny Payne
Post Count: 659
Star Member


--
08/17/2009 11:35 AM  
Vary headers allow you to change some element of a response (in this case, compression) based on a varying element of a request. Different browsers handle compression in different ways, so you typically want to vary on User-Agent to accommodate this. I believe that LTM has some built-in optimizations for compression if it is allowed to vary on User-Agent.

I'm sure you have your reasons for wanting to remove this (and I can't think of anything at the moment to improve on Aaron's solution), but that's why it is there.

Denny
sidiov
sidiov
Post Count: 9



--
10/05/2009 03:44 PM  
I want to resurrect this and ask if the OP ever got it working with just accept-encoding? I need this for our CDN network which only works with accept-encoding, and irules seem to have no effect on headers generated by the Load balancer, so I cant replace or insert new values.
spark
spark
Post Count: 290
Power Member


--
10/08/2009 05:33 PM  
If you need responses that the BIG-IP compresses to not Vary based on User-Agent, then you should disable the "browser workarounds" option in the compression profile, and make sure that compression to HTTP/1.0 clients is enabled.
Please login or join DevCentral to post a reply.

  

93,050 Members in 191 Countries and Growing!

Join DevCentral Today!

About DevCentral

F5 DevCentral is your source for the best technical documentation, discussion forums, blogs, media and more related to application delivery networking.

So dive in, meet your peers, and get familiar with DevCentral. We hope it makes your job easier and helps you get more from your F5 investment. If new to DevCentral, check out the Getting Started section. And if you have any problems, or think something could be easier to use, let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback      or