RFC 2616 with Apache 2.4
Solution 1:
You give a couple of examples like this:
Cache-Control: public, s-maxage=0
Expires: ... (+1 day)
X-Group: A
Vary: X-Group
ETag: W/"foo1"
I notice in particular the Vary: X-Group
header. Is X-Group
a request header or a response header?
As per RFC 2616 section 14.44, Vary
should list any request headers that will result in a different content representation from an origin server. From your example, I suspect X-Group
might be a response header, in which case mod_cache won't be storing multiple versions of the given resource.
One thing you could try would be to set Vary: If-None-Match
, which would let mod_cache store a version of the resource for each ETag. Admittedly, I haven't tried this. Assuming it works, one downside is that the first request from any client would be a cache miss.