zendframework/zf2 — pull request #5687 by androa (2014-01-06 13:46:54+00:00)
Title: The AcceptableViewModelSelector should send Vary-header when using the Accept-header.

The HTTP standard in [RFC 2616 Section 14.44]( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44) states that responses should contain a Vary header when doing server-side content negotation. This ensures that caches will handle the responses correctly.

>An HTTP/1.1 server SHOULD include a Vary header field with any cacheable response that is subject to server-driven negotiation. Doing so allows a cache to properly interpret future requests on that resource and informs the user agent about the presence of negotiation on that resource. A server MAY include a Vary header field with a non-cacheable response that is subject to server-driven negotiation, since this might provide the user agent with useful information about the dimensions over which the response varies at the time of the response.

The PR only includes a test since I'm a bit unsure on how to implement this cleanly.