![]() |
Template caching doesn't seem to be working
In my config.php file, I have the following line enabled:
Code:
$config['Datastore']['class'] = 'vB_Datastore_XCache'; Code:
PHP 5.4.20 (cli) (built: Oct 14 2013 16:02:24) So here's the problem - I have many templates cached via plugins in the cache_templates hook like so: Code:
$cache[] = 'mytemplate'; Every single refresh, it runs this query 20 times: Code:
SELECT Shouldn't template caching ultimately result in fewer queries every few reloads? Thanks! |
Have you checked with your host to make sure it really is installed also check server error logs
|
That query isn't to fetch a template, its a query to fetch data.
The datastore doesn't cache templates either. The cache doesn't cache the page output either. I don't think the cache you're looking at does what you think it does. |
Hmmm..interesting .....
|
Thanks everyone! This is very interesting. I'm trying to learn a lot more about optimizing vBulletin, and I've come pretty far on most pages! Cut down load times from 2 seconds to .5 seconds (and CMS from 8 seconds to .7 seconds). A lot of these had to do with old poorly designed mods.
But this memberinfo / template caching has me confused. I guess my question here would be, how can I just keep that fetch data query cached for a few minutes, so it doesn't need to reload every time? I figured out that query seems to be coming from fetch_avatar_url, which I use to show the avatar of the "Thanker". Why in the world does it need all of that data in the query? Can't it just grab the avatar info? And again, same question as above, how can I keep this information cached so it doesn't run the query every time? For example, when I look at the queries on a regular posting thread, I don't see that fetch data query run once. And yet magically, I still see everyone's avatar and username on the page! --------------- Added [DATE]1408372276[/DATE] at [TIME]1408372276[/TIME] --------------- Ah bummer. Found the problem in functions_user.php: Code:
function fetch_avatar_url($userid, $thumb = false) As a solution, I will rewrite this as two functions, one for thumbnail, one for non-thumbnail. That way both can cache. |
All times are GMT. The time now is 05:17 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|