Why visitors see "404 Not Found" on some assets after a deploy of a Private Spaces app?


Visitors to my Private Spaces app sometimes have a problem in viewing the page and see "404 Not Found" errors on some of assets. It seems to happen when the app is being deployed.


Every request to an app with multiple web dynos will be randomly distributed to a healthy dyno. Additionally, web page requests (GET /index) and any/every asset request (GET /css/bundle.css, GET /js/loader.js, GET /js/react.js) are unique requests. If the asset filenames change between releases, requests that are routed to a dyno with a different version of assets than the version of the application it retrieved the page from, may fail.

This behavior in Private Spaces is due to an application's dynos performing its rolling deploy.

Rolling Deploys cannot be disabled, and it is recommended that the application uses a CDN in front of the app ( https://buildingvts.com/serving-assets-while-rolling-your-deploys-c656ce6a2123 ), or any solution that preserves old assets between releases for at least an hour.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support