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:


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?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.