Web caching on my NAS
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.
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…