Issue: ERPNext Fetching Old Frontend Code Even After Migration & Rebuild
Hi everyone,
I’m experiencing a strange issue on multiple ERPNext sites where the frontend keeps fetching old code, even though:
-
I’ve created and pushed changes in a custom app
-
I pulled the latest code on the server
-
Ran
bench migrate
,bench build
, andbench restart
-
Cleared website cache using:
bench --site my-site-name clear-cache bench --site my-site-name clear-website-cache
-
Cleared browser cache (even used incognito and different networks)
-
The code (e.g., certain JS functions or HTML blocks) does not exist anymore in the server files, but it still shows in the browser
-
Reinstalled the app and reloaded docs
-
Confirmed the correct app is installed and listed via
bench list-apps
Despite all this, ERPNext keeps serving old cached frontend assets, like JS or HTML templates.
Environment Details:
- ERPNext Version: ERPNext: v15.43.0 (version-15)
- Frappe Framework: v15.48.0 (version-15)
- Hosting: [VPS]
- Reverse Proxy: Nginx (default from bench setup)
What I’ve Tried:
bench build --force
bench restart
sudo service nginx reload
- Verified files are updated in
apps/my_custom_app/
- Changed browsers and devices
Still, the browser shows stale assets and UI from previous versions of my app.
Question:
What could be causing this aggressive caching of old assets in ERPNext?
Is there something I’m missing in the asset pipeline, or does this relate to Nginx/Redis?
Any help would be appreciated.
Thanks in advance!