How to Disable Requirejs Cache in Magento 2

Image result for How to Disable Requirejs Cache in Magento 2

Hello everyone, In this blog I will discuss you how Magento 2 conveys the requirejs to load the JS module for the website page. Therefore it will improve the loading speed of the page.

When js is loaded from the server, the next time it is loaded from the browser’s cache. so, the speed will increase.Whereas, it is firm to improve developer product. Because when you edit the JS or the .html file of knockout, you want to clear the browser’s cache.

Here, I will explain you how to disable the cache in Magento 2. When you create an extension in Magento 2, you do not 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:

Disable Requirejs Cache

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: December 21, 2018  

February 23, 2018   416   Nandini R    Java Script    
Total 1 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
Google+
https://www.webnexs.com/blog/kb/disable-requirejs-cache-magento-2
Twitter
LinkedIn