The Power of Local Caching: Speeding Up University Labs
During university lab sessions, a common bottleneck emerges: bandwidth. When forty students simultaneously run an 'npm install', 'apt-get update', or 'pip install', external bandwidth is saturated, and productivity grinds to a halt. Recognizing this inefficiency, I set out to build a centralized caching proxy server.
Dockerizing the Solution
To ensure the solution was scalable and easily reproducible, I utilized Docker on an Ubuntu server. I deployed three distinct services: Verdaccio (a lightweight private npm proxy registry), apt-cacher-ng (for Debian/Ubuntu software packages), and pypi-devpi (a Python package index and caching server).
By containerizing these services, the entire caching infrastructure could be spun up or torn down with a single docker-compose command.
Automated Client Configuration
Setting up the server was only half the battle; configuring client machines to actually use the proxies was the next hurdle. I developed automated shell scripts that modified the respective package manager configuration files on client machines.
The result? The first student's request downloads the package from the internet and caches it locally. The next 39 students fetch the package directly from our local lab server at gigabit speeds, completely bypassing the external network.