How to Disable Requirejs Cache in Magento 2

Image result for How to Disable Requirejs Cache in Magento 2

Hi friends, here I will discuss you how Magento 2 brings the requirejs to load the JS module for the website page. Hence it will enhance the loading speed of the page.

If js is loaded from the server, the next time it is loaded from the browser’s cache. Therefore, the speed will rise. Though, it is hard to develop 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 show you how to disable the cache in Magento 2. When you create an extension in Magento 2, you do not need to clear the cache of the browser.

In your section, follow the below line:

urlArgs: “bust=” + (new Date()).getTime() // Disable require js cache

To your view/frontend/requirejs-config.js like this image:

Disable Requirejs Cache

After sorting the static-content, you can see that line in pub / static / _evirizzares / predefined / … / … / requjs-confjg.js. So require.js config has been renewed from now, you do not need to clear the browser cache when you create the extension in Magento 2.

Last Update: July 10, 2018  

February 23, 2018   353   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+
http://www.webnexs.com/blog/kb/disable-requirejs-cache-magento-2
Twitter
LinkedIn