I'm building a commerce site, one problem that I have is that the variation switch that works with ajax is having problems on the production server.
I have analyzed the network tab of DevTools, the situation is the following:
- I go to a product and can switch between its variations.
- If I add a product to the cart, then I cannot switch to another variation, the ajax request is made but instead of returning a JSON the response is a html with the whole page which results in the error.
The Ajax request url is something like:
/product/54?v=3037&ajax_form=1&_wrapper_format=drupal_ajax
If I disable the cache for dynamic content in settings.php
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
Then everything works without any problems, is there a better solution for that?