![]() ![]() ![]() We have three upstream servers that we want to cache: Our private Nix cache is implemented as an Nginx server that is running on a box in our office. This will speed up the downloading of build dependencies and minimize the amount of traffic that needs to be downloaded from outside the office network. And in this blog post we will explain how you can set up a private Nix cache in your office. content distribution networks (CDNs) work. The key property that makes this design possible is the immutability of the URLs. And the latter caching server can then point to the origin server. Another neat consequence is that you can have a hierarchy of caching servers: One caching server can point to another caching server as its upstream. This way you can horizontally scale out the number of caching servers. One neat consequence of this design is that you can have many caching servers that all point to the same origin server. Whenever the caching server gets a request from a client for a URL that it has already previously requested from the origin server, it can serve the cached response instead of going back to the origin again. Imagine also that you have an origin server that serves the original data, and you have a caching server that is allowed to cache responses from the origin server. Your first design decision would be that the same URL should always return the same data, i.e URLs should be immutable. Imagine you would want to build a centralized caching system for arbitrary data that works over the internet. See our previous blog post for an intro to the Nix package manager. Summary: We set up a private Nix cache for our office to (massively) speed up downloads and to save large amounts of bandwidth. ![]()
0 Comments
Leave a Reply. |