Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 18 Aug 2014, 05:14
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Question Template caching doesn't seem to be working

In my config.php file, I have the following line enabled:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Server shows xcache installed:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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!

Last edited by findingpeace; 18 Aug 2014 at 05:30.
Reply With Quote
  #2  
Old 18 Aug 2014, 06:19
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Have you checked with your host to make sure it really is installed also check server error logs
Reply With Quote
  #3  
Old 18 Aug 2014, 08:00
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
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.
__________________
Looking for ImpEx?
Reply With Quote
  #4  
Old 18 Aug 2014, 08:06
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Hmmm..interesting .....
Reply With Quote
  #5  
Old 18 Aug 2014, 13:02
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
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 18 Aug 2014 at 15:31 ---------------

Ah bummer. Found the problem in functions_user.php:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

C'mon vb developers!

As a solution, I will rewrite this as two functions, one for thumbnail, one for non-thumbnail. That way both can cache.

Last edited by findingpeace; 18 Aug 2014 at 15:39.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 11:45.

Layout Options | Width: Wide Color: