Magento – Magento 2 How to make magento not to cache static content of Checkout module

cachemagento2static-content

I'm modifying the checkout process, every time I edit a html file or a javascript file, I must use the command magento setup:static-content:deploy because the html or javascript is cached by magento. Doing deployment is very time wasting, how to make the magento not to cache the static content? I've tried to switch to developer mode, but the static content still be cached.
Thanks

Best Answer

Require JS will cache the changes to your javascript files (even in developer mode). To disable caching, add the below to MyNamespace/MyModule/view/frontend/requirejs-config.js

var config = {
    urlArgs: "bust=" + (new Date()).getTime()
};
Related Topic