Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
29 Jan 2016 at 17:07 UTC
Updated:
1 Feb 2017 at 08:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mglamanPR active: https://github.com/drupalcommerce/commerce/pull/341
However we need tests to verify cache is busted.
Comment #3
subhojit777PR updated https://github.com/drupalcommerce/commerce/pull/341/files
Tests not yet added.
Comment #4
mglamanWe'll want to add the cart cache context first, then try using that. See #2802941: Add a Cart cache context.
Comment #6
mglamanCrediting steveoliver for work on https://github.com/drupalcommerce/commerce/pull/528
Comment #8
bojanz commentedCommitted the cart cache context, now we need to use it. I guess that means rebasing PR #341?
Comment #9
mglamanComment #10
mglamanHere is patch which fixes the cart cache context and fixes cachability of our block. Removes max age!
Comment #12
mglamanComment #13
wim leersInteresting! The cart cache context looks fascinating. Why are there multiple cart IDs? Does this then automatically ensure that all anonymous users without carts have the same cache context value and hence get the same render cached cart block?
I am not seeing the necessary test coverage to ensure that the cart cache context works as intended/expected in all those situations…
Comment #14
mglamanUsers can have multiple carts based on order type and store. You could have a Digital and Physical order for US store. Or a Physical order for both the US and FR store. So if someone gets a new cart for some reason the cache should bust because new ID.
I suppose you're correct that anonymous users would all have the same render cached block, because no cart IDs, same cache key.
I made some comments here: https://github.com/drupalcommerce/commerce/pull/586#pullrequestreview-14.... I needed the tags in both places otherwise the tests would fail.
Our main tests are https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/cart/tes.... You're correct it doesn't test the multiple cart, which it should.
Comment #15
wim leersOh, interesting! That sounds complex UX-wise, but that's a different realm of concern :)
That sounds like it only works correctly by accident :P Or perhaps by intentional @bojanz design.
I left a reply there, which I'm repeating here:
In other words, this change is pointless.