Alex Rivera | Logout

Vary: * incorrectly added to http header response (asp.net mvc3)

Asked 2012-08-03T12:08:49.983
8

I am using the following output cache profile:

<add name="MyFunkyProfile" duration="180" varyByParam="*" location="ServerAndClient" />

In dev, I have a response header with one Vary entry:

HTTP/1.1 200 OK
Server: Microsoft-IIS/7.5
...
Vary: Accept-Encoding
Cache-Control: private, max-age=180, s-maxage=0
...

When I deploy my app, I have an extra Vary entry inserted in the response:

HTTP/1.1 200 OK
Server: nginx
...
Vary: Accept-Encoding
Cache-Control: private, max-age=180, s-maxage=0
...
Vary: *
...

Why this extra Vary entry? This is preventing the cache from working correctly.

Any ideas how to fix this?

Edit
Report

1 Answer

0

The Vary: Accept-Encoding header is inserted by the AppHarbor routing layer. The header is necessary to get downstream proxies (typically a CDN like AWS CloudFront or similar) to correctly cache both gzip'ed and non-gzip'ed versions of your content. This question has additional details.

Can you detail how this is causing problems for your application?

answered 2012-08-06T21:40:42.920

Your Answer