0

I'm attempting to set up a local repository cache for dnf. The idea is for one machine on the network to download a package, then any other machine on the network attempting to acquire the package will receive it from the cache. I'm using squid for this, and currently have dnf requesting packages through the squid server, but squid is recording a miss every time. I'm unsure what is causing this, so I'll copy in the typical access.log message and relevant section of squid.conf.

1450150756.680    131 10.64.9.57 TCP_MISS/200 183815 GET 
http://mirror.crucial.com.au/fedora/linux/updates/23/x86_64/l/libquadmath-5.3.1-2.fc23.x86_64.rpm - 
FIRSTUP_PARENT/[parent-proxy-url] application/x-redhat-package-manager 
[Host: mirror.crucial.com.au
User-Agent: dnf/1.1.4
Accept: */*
Proxy-Connection: Keep-Alive] 
[HTTP/1.1 200 OK
Expires: Sun, 13 Dec 2015 22:57:47 GMT
Server: nginx/1.8.0
Date: Tue, 15 Dec 2015 03:39:07 GMT
Content-Type: application/x-redhat-package-manager
Content-Length: 183182
Last-Modified: Thu, 10 Dec 2015 20:53:32 GMT
ETag: "5669e64c-2cb8e"
Age: 0
Connection: keep-alive
Proxy-Connection: keep-alive
Via: 1.1 NZ8KS49CH
X-Cache-Lookup: HIT from NZ8KS49CH (M86 Security Proxy Cache)
X-Cache: HIT from NZ8KS49CH (M86 Security Proxy Cache)
X-WebMarshal-RequestID: C3F30882-D914-481F-8E60-2AD367A4A046]

And here's the conf:

cache_peer [parent-proxy-url] parent 8081 0 no-query no-digest proxy-only default login=[user]:[pass]

acl all src 0.0.0.0/0 ::/0
never_direct allow all
maximum_object_size 4096 MB
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 10000 16 256

# Leave coredumps in the first cache dir
#coredump_dir /var/spool/squid

cache_replacement_policy heap LFUDA

acl filetype urlpath_regex \.rpm
cache allow filetype
send_hit allow filetype
cache deny all

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern -i .rpm$ 129600 100% 129600 refresh-ims override-expire
refresh_pattern -i .iso$ 129600 100% 129600 refresh-ims override-expire
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

I also noted that when I had it set up so my web browser was directed through squid, some things were cached. Once I set up the dnf only, nothing caches ever.

1 Answers1

0

Figured it out. The cache_peer line included "proxy-only", which stops squid form caching anything from that peer. Removing the "proxy-only" term fixed the issue completely. I think I picked it up from some tutorial online which must have been attempting something different to me.