Caching Forged Alliance Forever downloads

In additional to this post here about caching steam games

I’ve run a few LAN parties where downloading updates from the FAF servers can take a while. This is no fault of the FAF servers, just i’ll have up to 10 people hitting the same mod and we all sit there watching progress bars as it downloads.

solution : modify the steamcache container image to also cache downloads for FAF
added benefit : takes load off the faf servers

If you want to give it a go, all you need to do;
(you’ll need a bit of experience with docker / containers)

  • download and run steamcache/steamcache container. This is effectively a reverse proxy running nginx. You can download the image form here https://hub.docker.com/r/steamcache/steamcache/
  • modify /etc/nginx/sites-available/steamcache.conf file in the container. Add the following directly below the existing “location /depot/” entry (for steam) to cache all /faf/ URI requests;
location /faf/ {
try_files $uri @mirror;
access_log /data/logs/access.log steamcache-local;
}
  • redirect local DNS queries for content.faforever.com to your local server (above). I entered a host entry on my local DNS (pfsense : resolver)
  • profit

There is a built-in script /scripts/watchlog.sh that displays access.log and highlights in green any cache HITS (why i’ve left logging classified as “steamcache-local”)

steamcache for gaming

Assuming you have docker running at home, check out these two docker projects – one is the cache (powered by nginx), the other is the dns servcie (which intercepts steam calls)

  1. https://hub.docker.com/r/steamcache/steamcache
  2. https://hub.docker.com/r/steamcache/steamcache-dns
  3. https://hub.docker.com/r/steamcache/sniproxy

When you have all three up and running you can confirm HITS to the cache by running the following against the steamcache container;

docker exec -it steamcache tail -f /data/logs/access.log

This is great if you have a gaming cafe or LAN over at your house on occasion, all steam games will be cached to local disk so that your internet pipe gets a break. ;)

Update 15/10/2018

  • Added SNI-Proxy. More and more HTTPS request break above if not implemented. Steam is pushing some images / videos via HTTPS now.
  • Replaced steamcache/steamcache with steamcache/generic – seems to have more active development around it
    • watchlog.sh does not appear to be in generic cache yet.

Update 1/11/2018

  • Switched back to steamcache/steamcache. steamcache/generic was much slower (re-validated downloads etc) which isn’t needed for my small network. I’m after performance! :)
  • Also modified nginx conf on steamcache container image to download and cache FAF (forged allinace forever) updates. Much faster!