We are the devs from Team Netlify, Ask us anything!

View other answers to this thread
Sarthak Batra's photo

Hey, thanks for doing this AMA. Since netlify does atomic builds, when we deploy a new build, users who are on a previous build have to refresh their page to get the new assets. Are there any plans to save the assets, from say the last 10 builds, kind of like how one would do if they were serving assets from Amazon S3?

swyx's photo

dx @ netlify

This is a tricky one. Yes, the assets are always saved, because every deploy is immutable and you can roll back to it any time (instead of my-site-here.netlify.com it looks like deploy-239829837293872-my-site-here.netlify..).

but your question is more about how can you have a previous build reference the assets from that previous build. you can try to use your build step to inject the direct reference to the immutable deploy by id, where you can access those previous assets. however this may be overengineering the solution, as it still doesnt save you from other breakages like external api changes. in my experience the best practice is just to detect an update and prompt for a refresh.

Phil Hawksworth's photo

Developer Experience, Netlify

Also worth keeping in mind that if your site is html (rather than a self contained, JavaScript Single Page Application), then each navigation to a new page, will be making a traditional HTTP response, and be met with the lates resource held there.

So it's true that Netlify deploys are atomic, navigating to a new URL is a fresh request, so you'll not be navigating around a "stale" version of the site.

So this situation is limited to SPA's I think, and those often have mechanics to indicate something like TTL or similar to safeguard from long running stale content.