Breaking Image Caches
Posted: October 19th, 2005 | Filed under: Programming | 2 Comments »While I was tuning an Image Cache in BlogBridge, fetching different feeds, I noticed one interesting thing. Some feeds, for a reason, impenetrable to me, put random number in a query part of an image source URL, making it different every fetch. To make it more sensible, look at this:
I find it difficult to understand why one would use this trick other than to disallow caching of images. Every time an RSS reader application fetches such feed it sees the differences in text and updates a local copy of an article. Then it tries to lookup an image mentioned in the article, which is already in cache, but, thanks to new random number in the URL, the image can’t be found and is downloaded another time… and another. Frankly, BlogBridge is clever enough not to do this, but the whole idea is arrogant, in my opinion.
Why is it done this way? Any ideas?
The Ruby on Rails addict, industrial photographer and amateur electronic music composer. In the mean time I build great web applications, contribute to OSS and help AVAAZ to save Great Barrier Reef.
This usually done by people who don’t want others ’stealing’ their bandwidth be re-using their images. If Person A hosts lots of images on their site (e.g someone like Tim Bray who posts lots of photos he’s taken on his site) then sooner or later other people start using this pictures as background graphics. This leads to a situation where Person A is serving the same image to lots of people who are not even aware that the image comes from Person A but assume it comes from Persons B – Z. This can get very expensive very quickly if Persons B – Z link to lots of images on your site and host popular sites of their own.
Hm… But how it helps Person A? If I take URL from his feed, I still can reuse it everywhere as this random plays no role and even can be omitted.