Fixed
Separate the reverse proxy cache (e.g. Varnish) for gross and net by adding the VAT state to Shopware's
sw-cache-hashcookie (TUULZ-2723). Guests with an empty cart now get that cookie as soon as they have toggled; Shopware alone only sets it for logged-in customers, filled carts or a non-default currency. The toggle request already responds with the new hash, so the following reload no longer hits the page cached for the previous state. Checkout and offcanvas cart responses now produce the same hash as the rest of the shop instead of one based on the checkout default, so they no longer hand a net customer the hash of the gross page, and opening the cart no longer causes an extra cache miss. TheX-Tax-Stateresponse header is unchanged.Stop a single request from putting the wrong tax state into the shared cache (TUULZ-2723).
dmf-vat-statelasts a year, butsw-cache-hashonly for the browser session, so after a restart a net guest sent the VAT cookie without a hash. Varnish keys on the hash the client sends, stored that net page under the key every guest without a hash shares, and served net prices to all of them; a hash sent without the VAT cookie did the same in reverse. Responses whose hash differs from the one the client sent are now no longer stored, the same check core runs behind itsCACHE_REWORKflag, limited to requests with a VAT cookie or a hash. Shopware's own HTTP cache now also reads the VAT cookie for its cache key: it builds the key before the request is on the request stack, so the key part was always gross and returning net guests got the cached gross page. A returning net guest can still get the cached gross page from Varnish on the first page after a browser restart, until the cart widget request sets the hash again; only a VCL that also keys ondmf-vat-stateavoids that.