The idea behind Variant URIs is that for a resource that has Vary response headers, we store a "parent" cache entry, which has pointers (variant URIs) to "child" entries. The child entries will contain the "variable" content for that resource. So the parent entry becomes the map to find a given child entry, where the URI (cache key) has had a string like
prepended to it
So you might have a parent entry like this:
With children like these:
http://www.example.com/foo" (Caused by a request that had Accept-Encoding:gzip header)
http://www.example.com/foo" (Caused by a request that had Accept-Encoding:identity header)
The idea of keeping the list of variant children with the parent entry is so that we can clean up all child entries when a parent is invalidated. It prevents orphan cache entries.
Regarding the atomic updates, we had also started working on a patch for that, where CacheEntry had a new constructor that took everything you need, instead of the HttpResponse. Obviously all the other setters were to be removed also. This way, every time a cache entry is "pulled" from the cache, it is effectively a copy, rather than a reference.
The CacheEntryUpdater class would have to be changed slightly to work with this, but would not be especially difficult to do.