We experience an issue almost every single time we deploy new code to the website, whereby we get 404 errors for merged CSS/JS files. To me, this seems like there is something pointing to the location of the old file, which no longer exists.

Please see this for an example of how a page loads:

enter image description here

The weird thing about this issue, is that it only affects some people, or sometimes it affects you but when you refresh it's fixed. I've tried clearing local cache and this has not made a difference.

Our process during deployment is:

  • Maintenance mode enabled
  • Varnish restart
  • Setup upgrade
  • Setup DI compile
  • Setup static content deploy
  • Magento cache flush
  • Purge CloudFlare cache

As you can see, we are taking steps to ensure that the cache is cleared and it should be pulling the new files no problem, but the issue still exists.

This is affecting customer experience and sometimes is preventing the cart/checkout from working due to there being no JS on the page, so this is a huge priority for us to fix.

Any help or thoughts would be greatly appreciated!

1 Answer 1


You must missing to clear cache somewhere.

May be it can be CloudFare Cache, CDN, cPanel Cache, Varnish Cache, Radis Cache

Please make sure you almost cleared cache everywhere and please run below command in last too

php bin/magento cache:flush

I faced same issue in one of site but it's cloudfare. once we purge on cloud fare its all good.

  • Hi, we only use Redis for backend and session cache. Varnish is used for all page cache, and the only other cache we have is CloudFlare.
    – Keydose
    Oct 15, 2021 at 11:40
  • Have you cleared all that caches properly? Oct 15, 2021 at 18:05
  • Purge cache or set development mode on 3rd party cache.. Oct 15, 2021 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.