Questions tagged [vary]

The Vary response header is used for indicating to browsers and other user agents which request header values to check when deciding whether to load content from a cache or to instead fetch a new response over the network.

The Vary header is defined in RFC 7231 http://httpwg.org/specs/rfc7231.html#header.vary. Its value is a list of header names. Here’s a simple example of how it works:

  1. Code running in a browser at https://origin-a.com makes a request to https://some-server.com/some/path with the request header Origin: https://origin-a.com.
  2. The https://some-server.com server sends back the response with the content from /some/path and the response header Vary: Origin.
  3. A browser receives the response and caches the content from /some/path.
  4. Code running in the browser at https://origin-b.com makes a request to https://some-server.com/some/path with the request header Origin: https://origin-b.com.
  5. The browser sees that the Origin request-header value for the code from https://origin-b.com is different from that of https://origin-a.com, so instead of using the /some/path content it cached previously, the browser fetches a new response from https://some-server.com/some/path over the network.

For more details, see the following:

41 questions
0
votes
1 answer

Is there a way to vary the needed function input?

I have the following function: my_fct <- function(input1, input2, input3) { output <- df %>% filter(x = input1 | x = input2 | x = input3 ) } with let's say input1 = c(1:10), input2 = c(1:10), input3 = c(1:10) In some occassions, I only…
sebmw
  • 25
  • 4
0
votes
0 answers

Apache directive leads to Vary: header entry

I am using a // Set some magic here in my Apache (2.4) config. This leads to a an "automatic" entry in the Vary: response header (if the stuff within the section applies) like Vary: other…
Schubi Duah
  • 309
  • 1
  • 7
0
votes
1 answer

HTTP Header Vary - Order of values

We serve files for our websites to which we add CORS headers. The Vary header is required for cache management at the CDN and browser level. So the question: is there any importance in the order of the values in this header? Vary: Origin,…
Acti67
  • 577
  • 4
  • 11
0
votes
1 answer

WCF Service with Output Cache Profile sets Vary: * header

I have a WCF service which uses an OutputCacheProfile to get a one hour output cache time The output caching works, but…
Debby Mendez
  • 691
  • 10
  • 16
0
votes
1 answer

How to add vary custom header

My application is changing the content based on user country code. Server request flow https request -> nginx handle the ssl termination -> varnish -> if not cacheed, get contents from apache http rquest -> varnish -> redirect to https link ->…
Bilal Usean
  • 2,322
  • 3
  • 22
  • 45
0
votes
2 answers

How to disable Vary header in bitnami wordpress

Which version of the application are you using?: WordPress 4.8.2 Please choose how you got the application: Installer (Windows, Linux, macOS), cloud image (AWS, GCE, Azure, ...) or VM (VMDK, VBOX): google cloud Have you installed any plugin or…
Qiang Zhao
  • 11
  • 4
0
votes
1 answer

Remove XForward-ssl from Vary header(Apache webserver)

We have an Apache server sitting behind load balancer which is terminating SSL. For business reason we cannot disable HTTP completely . But want some of the url to redirected to https which works with below eg. RewriteCond %{HTTP:X-Forwarded-SSL}…
Rakesh
  • 35
  • 5
0
votes
1 answer

Http headers max-age not caching when vary accept-encoding

I'm trying to make a static files to be cached in the browser for a small amount of time (10 sec). It seems to be working properly when refreshing page. - 200 if you are new - 200 served from cache if you soft-refresh during the first 10 sec -…
kitimenpolku
  • 2,604
  • 4
  • 36
  • 51
0
votes
1 answer

If the same URL can serve different content types shoud Vary include accept?

If the same URL can serve different content types for the same resource, must Vary include Accept ? Or do browser caches and proxies understand it as being implicit ? Example: GET /some/thing HTTP/1.1 Accept: application/json This response HTTP/1.1…
redben
  • 5,578
  • 5
  • 47
  • 63
0
votes
3 answers

How to change color of a button when it is pressed like in a quiz app?

I'm willing to create a android quiz app. I've done all things and my app is completed but I'd like to make the quiz option buttons to change its color when it is pressed by user in order to show whether the answer is correct or wrong. I'd like to…
0
votes
2 answers

adding the vary by user agent header- per site or per page?

After reading google recommendation on using the Vary header on mobile sites that deliver different html/content for the same url, I was trying to figure out what happens if you have a new mobile site for example and it only covers some parts of…
nieve
  • 4,601
  • 3
  • 20
  • 26
1 2
3