![Announcement icon Announcement icon](https://www.drupal.org/files/styles/grid-2-2x-square/public/announcements/drupal-evergreen-logo-280X280px%20%281%29_0.jpg?itok=PHpn6rCb)
A Drupal core change #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!) broke some of our tests:
Drupal\uc_cart\Tests\CartCheckoutTest
Drupal\uc_cart_links\Tests\CartLinksTest
Drupal\uc_payment_pack\Tests\PaymentPackTest
Drupal\uc_product_kit\Tests\ProductKitTest
Leaving this open as a tracking issue until we figure out how to address this core change.
Comments
Comment #2
longwaveI did make a start on this but don't have a fully working patch yet. We need to add cache tags and contexts to our cart output. As a stopgap we could disable caching entirely for the cart and checkout pages and then incrementally improve this, though we really need to at least allow the cart block to be cached correctly.
We also should add further tests to ensure the output is cached correctly and that users cannot see other user's cached carts etc.
Comment #4
longwaveUseful documentation is at https://www.drupal.org/developing/api/8/render/arrays/cacheability and https://www.drupal.org/developing/api/8/cache
I think I've correctly added the necessary contexts and tags to the cart pages in http://cgit.drupalcode.org/ubercart/commit/?id=2853ed7
Comment #5
longwaveI think we also need getCacheContexts() and getCacheTags() methods adding to CartBlock, along with some tests.
Comment #6
longwaveComment #8
longwaveI pushed some more fixes for the remaining failures. The checkout form has a lot of dependencies and I couldn't figure out how to cache it safely so it is marked to never be cached; I think this is good enough for now.
The catalog test failure turned out to be unrelated to the dynamic page cache and is actually a consequence of #2492839: Views replacement token bc layer allows for Twig template injection via arguments.
Comment #9
longwaveTests are running green again.