For me, this problem first showed up as a ChunkLoadError in Webpack. As the answer explains, it applies to all scenarios where assets are tagged with a hash in the file name and is not even specific to Webpack.
Using Webpack to do code splitting and lazy-load chunks as needed. For example, let's say its an app for a pet store. When you first load the site, it loads all the JS needed for navigation on the home page. As you browse to different sections, it loads the code for each section on demand.
So when you click "turtles" in the menu it loads a file called turtles.abc123.js with all of the turtle-related code. (The "abc123" is a hash used for cache management.)
Except while you were browsing, we put out a new release with some changes in the turtle code, replacing turtles.abc123.js with turtles.e1337b.js. When you click the turtles section, it tries to load turtles.abc123.js, a chunk which no longer exists, resulting in a ChunkLoadError.
It seems to me that the solution to this problem is to not delete old chunk files. That's not a problem as long as we're happy with accumulating a new set of chunk files with every release. We'll end up with hundreds of files pretty quickly. Not necessarily a bad thing but it seems unwise to let that carry on unbounded. At some point disk space will become an issue.
My next thought was to delete files that are more than a week old since it's pretty much impossible for someone to stay logged in for that long and logging out refreshes the page.
I don't see anything about keeping files around for a period of time in either the Clean Plugin or Webpack's output.clean option. That suggests keeping files around for a period of time is not a common practice.
What is a common practice? Does everyone generally choose to either not worry about the stale release problem or not worry about the accumulating files problem? Or is there another solution I haven't considered?