The webcam image at is ... / 2014-02-06

2014-02-06 The webcam image at is ... 4 years ago
The webcam image at is getting popular at the moment due to the use by peaking at 0.5 requests/second.

Since the image is imported from a different server in a proxying setup this was causing quite some traffic on my adsl line. The image doesn't update every second, so I had a look into caching possibilities with apache 2.2. I wanted to use the memory cache for just this one object but I started with the disk cache because it's easier to debug and see the files on disk. This didn't work, and I could not figure out why. I followed the instructions found in apache2 - Apache Reverse Caching Proxy - why isn't it caching? - but still no caching happening.

I set up a separate virtual server with the logging set to level 'debug' and found the following interesting line in the log:
[Thu Feb 06 16:24:59 2014] [debug] mod_cache.c(370): (12)Cannot allocate memory: cache: Cache provider's store_body failed!
This looked more like a memory cache problem than a disk cache problem. But the memory cache wasn't configured at all. I decided to remove the memory cache support completely and that fixed things with the disk cache. The debug log suddenly had the right messages:
[Thu Feb 06 16:25:59 2014] [debug] mod_cache.c(633): cache: Caching url: /camwindow.jpg
Now the webcam image is cached for 120 seconds. Which saves some traffic on the ADSL line.

Update 2013-02-10: Requests still going at about 0.5 requests/second at busier times. The proxy reduces the impact on ADSL traffic and ping delays.

Tags: , ,

, reachable as PGP encrypted e-mail preferred.

PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers pgp key statistics for 0x5BA9368BE6F334E4 Koos van den Hout
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated in 0.010675 seconds.