I created a util.js file and added it to hooks.py. It worked the first time, but after I make changes to util.js, the updates are not reflected in the browser.
Currently, I have to rename the JS file and run bench restart to see the changes, but that’s not a good solution.
How can I properly update or reload the JavaScript file after making changes?
I always face this problem, it is mostly properly related to your web browser cache. The only way i know in ‘Google Chrome’ is as follow (or any equivalent method in other web browsers):
- Press 3 Dots on top right of your browser
- Got to Settings
- Click the ‘Privacy and Security’ section on the left sidebar
- Click the ‘Delete Browsing Data’
- Just select ‘Cached Images and Files’
- press ‘Delete Data
- Refresh your ‘ERPNext’ website or use ‘Ctrl +Shift + R’ for Clear Cache Reload
- Changes should reflect now in your website immediately
Go to any web page where that js file is used > Right Click > Inspect > Networking > Check Disable Cache. And keep networking tab open, then a refresh will do the work.
Worked perfectly with me. Thanks!
Sorry for bumping an old thread, but for anyone revisiting this: switching to another browser temporarily might help confirm if it’s a caching issue. Sometimes different browsers handle caching and updates in slightly different ways. Has anyone else experimented with browser extensions that manage cache more effectively? Would love to hear if there are any favorites out there!