Getting attachments with get_posts() function is one query, extracting its size and file location is another call to wp_postmeta where all data about an attachment is stored. So if you have 20 images in a post, you’ll end up with additional 21 queries. More queries means more load time for your server to response a request from browser.
Daniy Image Manager pull a post attachments from the wp_posts and wp_postmeta ONCE when the single page is requested, then the result is cached and stored in the vacant post_content_filtered field in wp_posts table. This means, on the next call to the same single page will also pull the attachments saved data in post_content_filtered field. All we have to do is unserialize it and output to browser. No more get_posts() or get_children() queries to database.
| Author: | Murdani Eko (profile at wordpress.org) |
| WordPress version required: | 3.0 |
| WordPress version tested: | 3.5.2 |
| Plugin version: | 1.3 |
| Added to WordPress repository: | 10-07-2013 |
| Last updated: | 10-07-2013
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
| Rating, %: | 0 |
| Rated by: | 0 |
| Plugin URI: | http://www.murdanieko.com/ |
| Total downloads: | 679 |
![]() Click to start download |
|
Getting attachments with get_posts() function is one query, extracting its size and file location is another call to wp_postmeta where all data about an attachment is stored. So if you have 20 images in a post, you’ll end up with additional 21 queries. More queries means more load time for your server to response a request from browser.
Daniy Image Manager pull a post attachments from the wp_posts and wp_postmeta ONCE when the single page is requested, then the result is cached and stored in the vacant post_content_filtered field in wp_posts table. This means, on the next call to the same single page will also pull the attachments saved data in post_content_filtered field. All we have to do is unserialize it and output to browser. No more get_posts() or get_children() queries to database.
