Apparently, calling a certain behavior function via JS when the page has loaded causes Boost to fail (i.e I'm not being served the boost files.). In this scenario I'm using Drupal Commerce Ajax Cart to trigger a cart refresh when the page has loaded (this is a commerce site, so refreshing certain parts with ajax is needed to get things working along with Boost).

I'm calling this function on $(document).ready():

Drupal.behaviors.commerce_add_to_cart_show_ajax_cart.fillCartBlock();

The function above looks like this:

$.post(Drupal.settings.commerce_ajax_cart.update_url_block,function(data) {
  jQuery('a.commerce-ajax-cart-loader').html(data);
}) ;

If I remove the call on document.ready, Boost works and I'm being served the static, cached HTML pages. However, if this call exists, I'm never served the HTML page (they are being created though). I'm struggling to wrap my head around why, since Boost shouldn't really be aware that I'm even calling that function since it happens after the pages has loaded.

Any ideas on how to solve this?

Comments

AdamGerthel’s picture

Issue summary: View changes
bgm’s picture

Can you check in your browser "network console" (F12) to see what kind of http requests are made, and if there are any differences when calling the main html page, with/without the JS? (check the main GET, and also the headers)