This option is already present in admin: options-image.
What I'm asking for is to have this option working also for the images that don't need to be resized for the regular view.
I found a way for have those cached, but it required a change in i.php, line 201 current nightly.
From:
if (!cacheImage_protected($newfilename, $imgfile, $args, $allowWatermark, false, $theme, $album))
To:
if (!cacheImage_protected($newfilename, $imgfile, $args, $allowWatermark, true , $theme, $album))
So the option is already there but I don't understand how to add it in theme's options.
Comments
For me it would be nice to avoid this passage when it's not needed.
I'm able to obtain this behavior but I would like to avoid changes in the main code.
I'll open a ticket. Is it possible to recover my old password or to delete my old account from track so that I can register again with my nickname?
Meanwhile I went further into this and I discovered that the 2 situations we where discussing above are actually different.
Case 1) Full images are smaller than sized images.
It's easy to force cache for them, reflecting the option in Image>Full_image. Just one line added and one line edited in i.php.
Case 2) Full images are bigger than sized images.
The force cache option doesn't work and I didn't find a simple workaround.
Btw, at least for Case 1, that is where it's more usefull, is really easy to get it working:
File: zp-core/i.php
before line 201 added the line:
$force_cache=getOption('cache_full_image');
ex line 201, now 202, changed to:
if (!cacheImage_protected($newfilename, $imgfile, $args, $allowWatermark, $force_cache, $theme, $album)) {
Hijacking this option for your us is a pretty bad idea.
On the other hand, I agree that the performance, especially over time, favors just caching the image. There is really quite a bit of computation made to see if the caching can be bypassed. It would be unreasonable to place that test where the image URLs are generated since that would be a mulitplicative effect. Also, most images will be cached, so the test for a small percentage of cases just does not computer[sic].
With tonight's build all normal images will be cached.
On my production site I already cache all (sized or not) images for image.php page but I'm sure you'll find a better way to do it.
There will be many benefits, also for easier image preload in browser.