Imageinfo Cache will generate image styles right after an image is uploaded and also on entity save. This will help with front end performance as the needed image style will already have been generated; thus the end user doesn't have to wait for the image to be generated. This can also mitigate some issues with image style generation if your CDN is configured incorrectly as the images will be generated without the request going through the CDN.
It can also put a cache inside of image_get_info() so that requests for image width, height, etc will come from the cache backend instead hitting the disk.
If you have
$conf['image_allow_insecure_derivatives'] = TRUE; in your settings.php file you can remove ?itok= from image urls.
You can also disable on-demand generation; so that on demand image generation is not possible unless you have the "administer image styles" permission. Image styles will still be generated on file upload and entity save.
Comes with a drush command called
image-generate. It will generate images for a given field and style.
Installation Notes: (7.x)
The HTTP Parallel Request Library module is recommended but not required.
If caching calls to getimagesize, then you might want to apply this core patch as well to avoid disk access to the image
Other Code Using It
Problem A: Your setup went from 1 server to multiple servers. theme_imagecache()/theme_imagefield_image() is taking a lot longer due to the files directory being a NFS mount (etc...).
Solution: Caching so PHP doesn't hit the disk to get the image info.
Problem B: Waiting for imagecache to generate all the images after you press node save.
Solution: Generate imagecache images right after the image is uploaded.
- Imageinfo Cache adds a caching layer right before theme_imagecache()/theme_imagefield_image() is called; thus future requests do not access the disk when requesting image_get_info() which calls getimagesize() and filesize(). This saves disk hits, and if your files directory is shared, you might see some big improvements in performance as a result.
- Imageinfo Cache will grab the image right after it's been uploaded from the CCK widget and will generate all imagecache presets. It will also run the file through the 2 theme functions mentioned above so the cache is primed. This happens in the background, not taking any resources from the
This module was created to solve a unique issue with a multi webhead system. Works best when not using the database for caching; recommend using something like memcache.
Installation Notes: (6.x)
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Media, Performance and Scalability
- Reported installs: 3,183 sites currently report using this module. View usage statistics.
- Downloads: 21,408
- Last modified: February 20, 2015
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.