Tagged: x
-
AuthorPosts
-
November 22, 2016 at 10:51 pm #1267761
I’m not sure if this is appropriate of the X theme forum, but is there an issue with posting a large (500) image gallery?
I’m finding that when I try and publish a post with a large gallery my SQL is falling over.
When I try to load the page it seems to run through and query each individual image as an sql query i.eSELECT post_id FROM wp_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘2016/11/sema_161104_342.jpg’
SELECT post_id FROM wp_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘2016/11/sema_161104_402.jpg’Not sure why it would want to do that but if you have a few people visit the site, say 10, thats 10x 500 query’s, so 5000 querys. The query probably does something silly like a full table scan which causes even more issues.
Has anyone encountered something similar?
Thanks
November 23, 2016 at 1:34 am #1267877Hi,
Can you provide us your site url so we can take a closer look.
Thanks
November 24, 2016 at 6:17 pm #1269955This reply has been marked as private.November 24, 2016 at 7:52 pm #1270116Hello There,
Thanks for providing us the information. Where can we find the page with a gallery of 500 images? I would suggest that you use a page gallery which would display at least 24 items per page. Hoping we can limit the query per page. And then maybe you can do something for the performance of the site like caching so that the site cache version will be served to the user and avoid having to do a query every time a user visits the page. For more details about performance, perhaps this page could help: https://community.theme.co/kb/performance/
Hope this helps.
November 27, 2016 at 8:00 pm #1272643We haven’t got the 500 image post available as it was crashing the SQL service.
Here is an example of an image gallery if that helps.
http://www.fullboost.com.au/fb/index.php/2016/06/13/city-ipswich-winternationals-day-3/
Thanks
November 27, 2016 at 9:28 pm #1272684Hi There,
That’s too much images on a page. Please use caching to improve site performance.
I also found a parser blocking issue on your pages. Please check this link:https://developers.google.com/web/updates/2016/08/removing-document-writeHope this helps.
November 27, 2016 at 9:48 pm #1272692Thanks
So even if we run a 100 image gallery, does it still query for each image?
November 27, 2016 at 10:39 pm #1272722Hi There,
Yes, but there is a work around for that which is paging. Your gallery will be divided into pages thus will limit the query needed.
You might also check the following links:
https://css-tricks.com/finding-and-fixing-slow-wordpress-database-queries/
https://codex.wordpress.org/High_Traffic_Tips_For_WordPress -
AuthorPosts