Local image caching

Is it possible to add option for caching of large images and converting small ones into data-URI form when downloading and then replacing links in the feed to those of cached images? I think it will be great feature.


Like that:
//settings
$cache_images_ = false;
$cache_images_datauri_size = -1;

RSS output before ->
<img alt="demo" width=1000 height=1000 src="http://www.zzz.ww/img1.png />
<img alt="small-demo" width=100 height=100 src="http://www.zzz.ww/img2.png />


//settings
$cache_images_ = true;
$cache_images_datauri_size = 100000;

RSS output after ->
<img alt="demo" width=1000 height=1000 src="http://www.mysite.tld/cached/img1.png />
<img alt="small-demo" width=100 height=100 src="data:image/png;base64,iVBORw0KGg…" />

Thanks for the suggestion. This is not something we plan to include though. Full-Text RSS already does quite a lot of processing to retrieve article text as quickly as it can. Adding image processing will not only complicate things further but will slow down the process too. For most people keeping the reference to the image intact is enough. We do want to improve the way we handle images, but mostly to make sure we’re preserving references to relevant ones.

Well, if such option can be disabled it won’t affect speed for those who don’t use it. Also what do you suppose will slow down the script? If it is base64 encoding - it’s only suggested for a small images and actually really fast with them (I’ve tried it) and link rewriting is even faster. Image downloading is most slow part of it, but it can be scheduled or paralleled and don’t affect script’s speed very much.

Dither

The general point I was trying to make is that it’s a lot of extra work for us, for little gain. :slight_smile:

:smiley: And my point was that this option can be helpful to you also, if you actually use this for getting news. Because it allows to “mirror” articles within RSS-client and normally read them if some interesting blog or site goes down. So it can be worth the time.

Dither