findingpeace
08-18-2014, 03:14 AM
In my config.php file, I have the following line enabled:
$config['Datastore']['class'] = 'vB_Datastore_XCache';
Server shows xcache installed:
PHP 5.4.20 (cli) (built: Oct 14 2013 16:02:24)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.0.3, Copyright (c) 2005-2013, by mOo
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.
with XCache Cacher v3.0.3, Copyright (c) 2005-2013, by mOo
Caching isn't disabled in ACP-->Options-->Server/Optimization Options.
So here's the problem - I have many templates cached via plugins in the cache_templates hook like so:
$cache[] = 'mytemplate';
But these templates aren't caching at all. For example, I have the "DBTech Thank You Hack" installed (shows recent "Thanks" in a memberinfo tab), so I tried refreshing on the memberinfo page every few seconds, but the debugger still shows the same number of queries. I don't have any new "Thanks" but it's still running 20 big queries on the same 20 recent members who thanked me. All just to get their username and post link (which it should already have in cache from my refresh moments ago!)
Every single refresh, it runs this query 20 times:
SELECT
userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate, user.languageid AS saved_languageid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight, customavatar.height_thumb AS avheight_thumb, customavatar.width_thumb AS avwidth_thumb, customavatar.filedata_thumb
, bu.bloguserid, bu.entries, bu.options AS blog_options, bu.subscribeown AS blog_subscribeown, bu.memberids, bu.memberblogids,
bu.subscribeothers AS blog_subscribeothers, bu.title AS blog_title, bu.description AS blog_description, bu.allowsmilie AS blog_allowsmilie, bu.draft AS blog_draft, bu.pending AS blog_pending, bu.options_member, bu.options_guest, bu.options_buddy, bu.options_ignore, bu.uncatentries, bu.moderation AS blog_moderation, bu.deleted AS blog_deleted, bu.akismet_key AS blog_akismet_key, isblogmoderator, bu.comments_moderation AS blog_comments_moderation, bu.lastblog, bu.lastblogid, bu.lastblogtitle, bu.categorycache, bu.tagcloud, bu.sidebar, bu.custompages, bu.customblocks, blockparsed.blocktext, 1 AS blogstyleid, blog_usercsscache.csscolors AS blog_csscolors, blog_usercsscache.cachedcss AS blog_cachedcss, IF(blog_usercsscache.cachedcss IS NULL, 0, 1) AS blog_hascachedcss, blog_usercsscache.buildpermissions AS blog_cssbuildpermissions, gm.permissions AS grouppermissions, ignored.relationid AS ignoreid, buddy.relationid AS buddyid, IF(blog_subscribeuser.blogsubscribeuserid, 1, 0) AS blogsubscribed, customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight
FROM vbuser AS user
LEFT JOIN vbuserfield AS userfield ON (user.userid = userfield.userid)
LEFT JOIN vbusertextfield AS usertextfield ON (usertextfield.userid = user.userid) LEFT JOIN vbavatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN vbcustomavatar AS customavatar ON (customavatar.userid = user.userid)
LEFT JOIN vbblog_user AS bu ON (bu.bloguserid = user.userid)
LEFT JOIN vbblog_custom_block_parsed AS blockparsed ON (blockparsed.userid = user.userid AND blockparsed.styleid = 1 AND blockparsed.languageid = 1)
LEFT JOIN vbuserlist AS ignored ON (ignored.userid = user.userid AND ignored.relationid = 1 AND ignored.type = 'ignore')
LEFT JOIN vbuserlist AS buddy ON (buddy.userid = user.userid AND buddy.relationid = 1 AND buddy.type = 'buddy')
LEFT JOIN vbblog_groupmembership AS gm ON (user.userid = gm.bloguserid AND gm.userid = 1)
LEFT JOIN vbblog_subscribeuser AS blog_subscribeuser ON (user.userid = blog_subscribeuser.bloguserid AND blog_subscribeuser.userid = 1)
LEFT JOIN vbblog_usercsscache AS blog_usercsscache ON (user.userid = blog_usercsscache.userid)
LEFT JOIN vbcustomprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
WHERE user.userid = #### LIMIT 1
Add on the tags/quotes mod, and my member info page gets REALLY slow.
Shouldn't template caching ultimately result in fewer queries every few reloads?
Thanks!
$config['Datastore']['class'] = 'vB_Datastore_XCache';
Server shows xcache installed:
PHP 5.4.20 (cli) (built: Oct 14 2013 16:02:24)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.0.3, Copyright (c) 2005-2013, by mOo
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.
with XCache Cacher v3.0.3, Copyright (c) 2005-2013, by mOo
Caching isn't disabled in ACP-->Options-->Server/Optimization Options.
So here's the problem - I have many templates cached via plugins in the cache_templates hook like so:
$cache[] = 'mytemplate';
But these templates aren't caching at all. For example, I have the "DBTech Thank You Hack" installed (shows recent "Thanks" in a memberinfo tab), so I tried refreshing on the memberinfo page every few seconds, but the debugger still shows the same number of queries. I don't have any new "Thanks" but it's still running 20 big queries on the same 20 recent members who thanked me. All just to get their username and post link (which it should already have in cache from my refresh moments ago!)
Every single refresh, it runs this query 20 times:
SELECT
userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate, user.languageid AS saved_languageid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight, customavatar.height_thumb AS avheight_thumb, customavatar.width_thumb AS avwidth_thumb, customavatar.filedata_thumb
, bu.bloguserid, bu.entries, bu.options AS blog_options, bu.subscribeown AS blog_subscribeown, bu.memberids, bu.memberblogids,
bu.subscribeothers AS blog_subscribeothers, bu.title AS blog_title, bu.description AS blog_description, bu.allowsmilie AS blog_allowsmilie, bu.draft AS blog_draft, bu.pending AS blog_pending, bu.options_member, bu.options_guest, bu.options_buddy, bu.options_ignore, bu.uncatentries, bu.moderation AS blog_moderation, bu.deleted AS blog_deleted, bu.akismet_key AS blog_akismet_key, isblogmoderator, bu.comments_moderation AS blog_comments_moderation, bu.lastblog, bu.lastblogid, bu.lastblogtitle, bu.categorycache, bu.tagcloud, bu.sidebar, bu.custompages, bu.customblocks, blockparsed.blocktext, 1 AS blogstyleid, blog_usercsscache.csscolors AS blog_csscolors, blog_usercsscache.cachedcss AS blog_cachedcss, IF(blog_usercsscache.cachedcss IS NULL, 0, 1) AS blog_hascachedcss, blog_usercsscache.buildpermissions AS blog_cssbuildpermissions, gm.permissions AS grouppermissions, ignored.relationid AS ignoreid, buddy.relationid AS buddyid, IF(blog_subscribeuser.blogsubscribeuserid, 1, 0) AS blogsubscribed, customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight
FROM vbuser AS user
LEFT JOIN vbuserfield AS userfield ON (user.userid = userfield.userid)
LEFT JOIN vbusertextfield AS usertextfield ON (usertextfield.userid = user.userid) LEFT JOIN vbavatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN vbcustomavatar AS customavatar ON (customavatar.userid = user.userid)
LEFT JOIN vbblog_user AS bu ON (bu.bloguserid = user.userid)
LEFT JOIN vbblog_custom_block_parsed AS blockparsed ON (blockparsed.userid = user.userid AND blockparsed.styleid = 1 AND blockparsed.languageid = 1)
LEFT JOIN vbuserlist AS ignored ON (ignored.userid = user.userid AND ignored.relationid = 1 AND ignored.type = 'ignore')
LEFT JOIN vbuserlist AS buddy ON (buddy.userid = user.userid AND buddy.relationid = 1 AND buddy.type = 'buddy')
LEFT JOIN vbblog_groupmembership AS gm ON (user.userid = gm.bloguserid AND gm.userid = 1)
LEFT JOIN vbblog_subscribeuser AS blog_subscribeuser ON (user.userid = blog_subscribeuser.bloguserid AND blog_subscribeuser.userid = 1)
LEFT JOIN vbblog_usercsscache AS blog_usercsscache ON (user.userid = blog_usercsscache.userid)
LEFT JOIN vbcustomprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
WHERE user.userid = #### LIMIT 1
Add on the tags/quotes mod, and my member info page gets REALLY slow.
Shouldn't template caching ultimately result in fewer queries every few reloads?
Thanks!