I have my form which adds an item to the cart, and open the sidecart. The code is as below,
<form action="https://<FOXY_STORE_DOMAIN>/cart" method="post" accept-charset="utf-8">
<input type="hidden" name="category" value="Category 1">
<input type="hidden" name="price" value="100">
<input type="hidden" name="code" value="somecode">
<button class="btn-inner add-to-cart-btn" type="submit">
<script data-cfasync="false" src="//cdn.foxycart.com/<?php echo FOXY_STORE_NAME; ?>/loader.js" async defer></script>
When I click the submit button for the first time, it loads some resources from the foxycart backend and then shows the sidecart. So, there is a lag between the button click and the sidecart display. However, when the button is clicked the second time, there is no lag as the resources are loaded already.
Is there a way to preload all the resources for sidecart, to eliminate the lag? or is there any other way to remove the lag?