I have an AngularJS application that is built for deployment with Gulp. We’re looking for a way to have previous output cached so that they will be deployed alongside each with each successive deploy. That way, if the client has a stale version of the index.html page, they’ll just have a slightly old version of the site running, rather than a blank page due to a 404 error loading in the assets. The names of the minified files built with each deploy are suffixed with a hash value, so they can all live alongside each other.
The issue I’m running into is that the caches are saved after the build phase, but the build itself is deployment-specific, so short of building for all of the environments in the “build” phase I’m not sure of a way to have the deploy products cached while keeping the CI build time short.