In this blog, I will show you how Magento 2 conveys the requirejs to load the JS module for the website page. Therefore it will increase the loading speed of the page.
When Requirejs is loaded from the server, the next time it is loaded from the browser’s cache. so, the speed will increased. Whereas, it is firm to make better developer product. Because when you edit the JS or the .Html file of knockout, you need to clear the browser’s cache.
Here, I will explain you how to disable the Requirejs cache in Magento 2. 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:
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 to clear the browser cache when you build the extension in Magento 2.
Last Update: February 22, 2019