In this blog, I will show you how to disable the requirejs cache in Magento 2 that conveys to load the JS module for the website page. Therefore, it will increase the loading speed of the page.
How to Disable Requirejs Cache in Magento 2?
When Requirejs is loaded from the server, the next time it is loaded from the browser’s cache. So, the speed will be increased. Whereas, it is firm to make better developer products. Because when you edit the JS or the. Html file of knockout, you need to clear the browser’s cache.
Here, I will explain to you how to disable the Requirejs cache in Magento. When you create an extension in Magento 2, you don’t want to clear the cache of the browser.
Follow the below line in your section on:
urlArgs: “bust=” + (new Date()).getTime() // Disable js cache
To your view/frontend/requirejs-config.js like this image:
After sorting the static-content, you can observe that line in pub / static / _evirizzares / predefined / … / … / requjs-confjg.js. So require.js config has been changed from now, you do not require clearing the browser cache when you build the extension in Magento 2.
Contact us to build an online multi-vendor store with Magento 2 today!!!