Now that Dynamic Page Cache has landed (https://www.drupal.org/node/2565453), we need to figure out a game plan for how this will work.

Comments

joshtaylor created an issue. See original summary.

bojanz’s picture

Our first step is ensuring our formatters declare the right cache contexts.

I spoke to WimLeers about our price formatters, and the fact that they depend on the locale (which is language + country).
After a lot of back&forth we decided that Commerce should not define a locale cache context, instead it should define a country cache context, then return language + country as the formatter contexts.

Issues:
#2571387: Convert the country and locale resolvers to return value objects
#2571393: Create a country cache context
#2571395: Return the right cache contexts from the price formatters

The next step is ensuring that the cart blocks and pages have the correct cache contexts (such as session).

bojanz’s picture

Title: Dynamic Page Cache for Drupal Commerce 2.x » Make sure the dynamic page cache works with Commerce

Retitling. We need to find out how to test this.

mglaman’s picture

Status: Active » Closed (outdated)

Going to close this as outdated. There's a 2.x site out in the wild, didn't notice issues. We also have some decent test coverage. Any items will be discovered and probably opened as individual bugs and not commented here.

felipep’s picture

If dynamic_page_cache is activated, I have issues changing the variation in the add_to_cart_form.

After an ajax request, if there is no article in the cart, then a JSON comes back, if I add an article to the cart and then change the variation then I got a html as response.

Disabling the dynamic_page_cache in settings.php solves the problem, but that is not a good solution.