Answer the question
In order to leave comments, you need to log in
How to work with static files when balancing?
Let's say I have 3 servers, all on nodejs. 2 of them are used to communicate with the client, 1 - for background scripts, and so on. By what means can I make sure that I update static files on the background server and 2 others immediately start sending new static files to clients.
This can definitely be implemented through proxy_pass (location /static/?), but the load on the background server will probably be large.
Answer the question
In order to leave comments, you need to log in
Request "two other" urls to the statics through the background with the cache - then they will download the file from it only once, put it in the cache and then will serve it from it.
Of course, when changing files, you need to change the URL to it on the page, for example, using the argument with the version.
In distributed systems, static is served from a separate repository. As a rule, this is called object storage. Servers in such systems are used only for computing power. If you write your own object storage, then there are a lot of different types of queues and replications, as well as distributed key-value storages
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question