Episerver 9 CertifiedMicrosoft Certified ProfessionalMicrosoft Certified Technology Specialist: .Net Framework 4, Web Applications

Speeding up game downloads with LanCache

Modern games these days are getting crazy big. Red Dead Redemption 2 weighs in around 90GB. Call of Duty Warzone comes in around 112GB.

I don't have a crazy big SSD in my gaming rig, so I find more often than not, I'm deleting and re-downloading when I switch games. Obviously, this can lead to some extended download times when the time comes to switch.

Now, I could just buy a bigger SSD, or even install the games on a normal, large-capacity mechanical drive.. but where's the fun in that? ;)

LanCache is a caching mechanism that sits in between the computer, and the internet. With some DNS hijacking, you can point Steam etc to your cache. Subsequent downloads of a cached game download at far higher speeds, because they are stored locally.

Installation of LanCache

As mentioned in a few other blog articles. I have a home server that is running Unraid. Unraid can run docker containers, so that's the route I took.

Adding LanCache to unraid is as simple as clicking 'Apps' in the main navigation, and searching for "lancache-bundle'. This will install the Lancache/Monolithic, Lancache/dns and Lancache/sniproxy containers in one bundle.

Give this container a static IP, point the bundle to a directory to store the cached files, and then finally (probably the most important) is to set the upstream dns to one that goes out to the internet. This is so that if the cache does not have the files locally, it can go and grab them from your game store of choice.

Then, set your dns server on the machine that you want to install the games on, to the IP address of the lancache

Once this is done, download a game from your store of choice. If all goes well, you should see it download at your normal download speed (possibly a little slower). Delete the game, then re-install it. Note. it's probably worth picking a small game for this..

At this point, you should be good to go.

Extending the system

If you have multiple machines, then you'd have to amend the DNS on each machine you want to run this on. This might not be ideal. Also, I run Pi-Hole, which is an ad-blocker that also runs on my server to provide network-wide advert blocking. This is also technically a DNS hijacker. So, having the two running together can be a bit of a pain.

In my router, I've manually set the DNS for my network to the IP address to that of the Pi-Hole docker, so that any machine on my network gets the ad-blocking benefits. Pi-Hole can also do conditional forwarding to a different DNS, depending on the configuration files. So, in order to get lancache capabilities working with Pi-Hole, I've used the uklans github page, which contains a collection of urls that relate to the various game stores (steam, blizzard etc). You add these to configuration files for Pi-Hole, and tell it to redirect all traffic to those urls to your lancache install.

for instance:

address=/lancache.steamcontent.com/192.168.1.200
address=/*.content.steampowered.com/192.168.1.200
address=/content1.steampowered.com/192.168.1.200
address=/content2.steampowered.com/192.168.1.200
.
.
.

for any traffic to content1.steampowered.com, will get redirected to the lancache.

Make sure that the lancache install has a DNS set up to go to the outside world.

That should be all you need!

Happy Caching!