Open matthewp opened 5 years ago
It's a web server right?
What if we had it expose a configurable, secure API endpoint that when hit could do the whole "refresh the cache" thing, so that if my static deployment workflow had a webhook option, I could trigger the SSR service to rebuild the cache with it?
Yeah that's a good idea too
Wouldn’t the endpoint just be hitting the server after a restart?
We're talking about not having to restart the server. Just change the static assets and then tell the server to update it's cache
Is that a common need? Generally on a deploy, I will re-install and restart everything. The node process itself doesn’t take long to restart.
I guess if you are really trying to maximize uptime, it might be nice to never take down the process...
It's a common feature for web servers to be reloadable without restarting the process. With Apache it is apache2 reload
. On Nginx it is nginx -s reload
.
The difference here is that @BigAB is suggesting exposing that as an API endpoint so that you can avoid having to deploy anything to the web server at all. How to do that securely I'm not sure though...
Currently when rendering a remote address incremental will download and serve static assets from a cache. The cache lasts until the next time the server restarts. In this way it's still better than having to deploy to a server every time; here you only have to restart the server.
Ideally we could do better though. A few options:
This issue is to begin discussing how we can improve asset caching when rendering from remote URLs.