Is this a crazy idea? I thought of it when I had to delete the cached files for one album but these were in the same folder with theme.txt and all other cached files. I could have selected individual files but if all cached files pertaining to one album (subalbum) had their own folder (subfolder), then cache clearing would be much easier. This does not seem like a big problem until your cache folder has literally thousands of files.
Comments
Actually, it's causing problems with those in php_safe_mode, which can't create script-writable directories. For that I might fall back on the one-directory strategy later, but everyone else will have `/cache/album/subalbum/file.jpg` structured cache.
Ok, have you implemented this one: When I load an album page for the first time the image compressor creates the cached thumbnails but only when an individual image is viewed for the first time, is its resized image file generated for display. Now, for personal albums this is no problem but the delay is large enough for public galleries that I actually browse through my gallery before e-mailing the link to others. That way they do not have to wait.
So what I am asking is this:
Trigger the compressor to generate ALL cache files (thumbnails and image files) for an album once it (the album page) is loaded.
One of the problems with that is the custom image sizes possible with each theme, so it'd have to take that into account, or produce some javascript which loads a preloader in the background.
The challenge is loading them in the background without making the user wait... I think that's possible.... we'd need a switch for i.php which returns nothing instead of an image, when asked to 'pre-load'. Should be possible.
We need better documentation for theme creators... man I can't wait to get the Wiki back up...
I've therefore tried a small patch on the i.php, as follows, to detect safe_mode automatically and adapt cache generation accordingly. It just simply switches off subdir generation and changes the "/" separator of the cached file to "___" (a random choice). Maybe more could be done with safe_mode_gid detection, which I didn't have time to try.
Could this patch make it into the standard distro?
The link to the patch: http://premek.abilo.net/index.php?s=txp&t=zenphoto-in-safe_mode
Premek
PS: My first post here, so I'd also like to give due credits to all Zenphoto developers for this piece of work :-)
Thanks for the patch.