Persistent storage between deployments


I am using Netlify to host a gatsby website that is a PWA and offline-friendly (using gatsby-plugin-offline). Whenever I update my website, a lot of the old assets are removed. Assets like JS bundles, CSS, and media. When people then come back to the website after an update, a lot of the website breaks until the service worker has updated and they have refreshed the tab. Not a great user experience.

This isn’t a Netlify problem, it can happen on any platform. Previously I solved this on other platforms by uploading my assets to something like S3 and then referencing the files from the website there. However, I wanted to keep everything inside Netlify and I can’t find the best solution for this. I just need persistent storage that I can write to, or to persist storage between builds. What is the best solution with Netlify?

Many thanks!

Yup, this is a pretty common use pattern. So common we wrote up the best practices around it:

Take a look and let me know if you can adapt to that workflow. If not, I don’t have any better suggestions, but your use case could help inform our future developments around this workflow so I am asking for a reason :slight_smile: