I’ve noticed that sometimes, some static files hosted on Netlify are slow to be served to the clients.
By slow, I mean, the first byte might take many seconds before being sent, and the request is pending for a while.
After the first byte is sent, trying to acces the file again with caching disabled it fast, as expected.
I can’t confirm yet but I suspect this happens after a new deployment, probably due to using a lazy strategy to propagate the files across the world/CDN?
The problem I encounter:
- I have a Gatsby site I modify/deploy often, and some pages have quite low access rates
- When clicking on a gatsby link, gatsby does code split the js into chunks so it has to download next page’s js chunk before navigating to it
- Due to some js chunks being served slowly by netlify (probably after a deploy), users are clicking on a link and just get no feedback at all, and then many seconds later, navigation happens
I could probably add some feedback, like a progress bar like github (nprogress etc…).
But I’d rather find a more general solution.
Is there a possibility to initialize the netlify deployment eagerly in such way that no file is ever server slowly? What would you recommend to solve this problem.