File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Header "Vary"

 
Bob Moranski
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I came across a aHttpServletResponse.setHeader("Vary", "Accept-Encoding"), but I had never heard of a header "Vary". This is called in a code, that depending on the request header, will either a)send GZIP format b)ZIP format c)regular OutputStream. So, I suspect the "Vary" header gives servlet flexibility in this regard. Am I right? Can someone please confirm to it?
Thanks.
 
Sagar Sharma
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i would also need reply to it....i have faced a similar type of code.
pls. clarify

sagar
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13044
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the Vary header in RFC 2616 - the HTTP 1.1 definative document. Thats a long section so I am just quoting the first paragraph:
"The Vary field value indicates the set of request-header fields that fully determines, while the response is fresh,
whether a cache is permitted to use the response to reply to a subsequent request without revalidation. For
uncacheable or stale responses, the Vary field value advises the user agent about the criteria that were used to select
the representation. A Vary field value of �*� implies that a cache cannot determine from the request headers of a
subsequent request whether this response is the appropriate representation. See section 13.6 for use of the Vary
header field by caches."
Download your very own copy from: http://www.w3.org/
So it looks like Vary controls caching somehow.
Bill

------------------
author of:
 
Bob Moranski
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bill, you are our X-mas present!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic