Web caching on my NAS

Squid cache logo

I have been running the Squid proxy software on my Synology DS 207 for over a month now, and I was curious to see how much traffic would end up being cached. My iPhone, my personal laptop and my Playstation 3 are all configured to use for regular HTTP traffic. So I downloaded the access log files and ran some Python on it.

The first thing to observe is that the amount of cache hits is relatively low: around 8% of the request were serviced from the cache. When counted in bytes, the efficiency of the cache is even worse: around 1% of the bytes were served out of the cache. This was to be expected, the largest download occur only once, so caching them makes no sense. Clearly whatever saving I get from the proxy is in terms of latency, in particular for the iPhone which has little internal cache. While the NAS has a latency advantage, it is not so big nowadays, ping times from my laptop to the NAS is around 2.5 ms, while the Apple software server (the first in the list below) is around 25ms, given the fact that the NAS serves out of its disk, I’m not sure the latency improvement of the cache is that great, I have to find a way to measure that…

The next question is what gets cached, besides a few places I go to regularly (like my blog), most of the cached servers are serving static content. So the proxy is its job properly: caching frequent, static content.

HostnameHits
swcdn.apple.com5363
r.mzstatic.com2996
images.apple.com629
a4.mzstatic.com555
a2.mzstatic.com554
pics.ricardostatic.ch541
illiweb.com535
a5.mzstatic.com532
a3.mzstatic.com508
a1.mzstatic.com494
fastcache.gawkerassets.com458
clients1.google.ch429
www.fr.ricardo.ch427
upload.wikimedia.org422
i4.ytimg.com389
static.arstechnica.net380

So what mimes mostly get cached, unsurprisingly, this is mostly images and text data.
The fact that many sites still are not configured to return the MIME type is worrying but well…

MimeHits
image/png8898
image/jpeg6976
text/plain5599
image/gif4801
text/html2650
application/x-javascript2019
text/css1495
-763
text/x-cross-domain-policy518
application/javascript505
text/javascript496
image/x-icon335
application/x-shockwave-flash313
application/xml259
application/x-x509-ca-cert150
text/xml137
application/vnd.google.safebrowsing-chunk126
application/pdf109
application/ocsp-response27
application/octet-stream19

Comments (1)

hashimWednesday 7 March 2012 at 10:33

Hi,
I am interested to know on how you implement the squid server on your NAS storage. Hopefully you would share you knowledge

Leave a comment

Your comment

Page optimized by WP Minify WordPress Plugin