Caching large objects and repos with Squid - Easy huh?

Squid{width=”500” height=”375”}

… yes it is. But only if you take care that the §$%&/() maximum_object_size directive appears above/before the cache_dir directive.

If you remember this, then Matt’s »Lazy distro mirrors with squid« tutorial is a great thing to lazily cache repos.

Personally I took a slightly different approach. I edited /etc/hosts to let download.fedoraproject.org point to my proxy, and configured squid as a reverse proxy.

…

# Let the local proxy accelerate access to download.fp.o
http_port 80 accel defaultsite=download.fedoraproject.org no-vhost
# Tell squid where the origin is
cache_peer download.fedoraproject.org parent 80 0 no-query originserver name=myAccel

# REMEMBER the ORDER
maximum_object_size 5 GB
cache_dir ufs /var/spool/squid 20000 16 256

…

# Caching of rpms and isos 
refresh_pattern -i .rpm$ 129600 100% 129600 refresh-ims override-expire
refresh_pattern -i .iso$ 129600 100% 129600 refresh-ims override-expire

Squid can be easily installed using:

pkcon install squid

::: {#footer} [ July 10th, 2014 12:00pm ]{#timestamp} [fedora]{.tag} [squid]{.tag} [yum]{.tag} [repo]{.tag} [caching]{.tag} [ovirt]{.tag} :::