Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Template Cache System Details »»
Template Cache System
Version: 2.5.4.0, by Trigunflame Trigunflame is offline
Developer Last Online: Nov 2019 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 03-11-2006 Last Update: 03-13-2006 Installs: 138
Code Changes Additional Files  
No support by the author.

Vbulletin Template Cache System
Optimize Your Forums!!


Notice:

While filesystem caching does provide a performance increase; it can be futher increased. I plan on including mmcache, eaccelerator, and APC shared memory support in the near future.

This will eliminate the need for reading/writing file to and from the filesystem.


Summary:

This modification will cache the templates that your forum uses to the file system saving you a mysql query.

Normally this data is requested from the database on every page load, with this however we cache all the templates we would normally use into a file to be included as a standard php code.

This will save you a pretty large query, the full size of the templates can be anywhere from 40kb to 200kb per page; even larger on some forums.

It will literally take 1 or 2 minutes to install, not long for the benefits that you receive.

PS. Use this in conjunction with my Other Hack (Compress Forum Templates) for speeding up your forum even more by compressing templates.
https://vborg.vbsupport.ru/showthread.php?t=107615
PS. Use this in conjunction with my Other Hack (Accelerated Plugins) for speeding up your forum even more by Inlining your plugins.
https://vborg.vbsupport.ru/showthread.php?t=107315


Instructions:

1. Download Zip File.
2. Read the INSTALL.txt
3. Click install if you like


Updates:
3/14/2006 8:34am : Large update, adding additional file locking code as well as moved some redundant code into functions. If you have an active site I recommend that you update with the newest version.

3/14/2006 7:07am : Cleaned up the code a little bit, no need to redo the edits unless you are a perfectionist like myself

3/13/2006 12:52 / Typo Update: There was a typo in the global.php edit, please re-do that step.

3/13/2006 11:48 / Massive Critical Update:
1. Automatically caches any uncached templates.
2. Files are now stored as .php files to prevent easy viewing.
I strongly recommend you update ASAP.
Just follow the INSTALL.txt and go through the procedures again.
PS. Make sure to empty the template_cache directory after upgrading. Thankyou.

3/12/2006 12:20pm
1. Now caches most action templates
2. The cache cleaner will not delete index.htm or index.html files.
3. Also updated the install.txt
4. Fixed parse error.
To upgrade, just re-do the code modifications listed in the install.txt file.
PLEASE clear the template_cache directory, after you redo the modifications. The new changes cache the actiontemplates as well.


Troubleshooting:

Start browsing your forum, going to your main page then browsing threads etc.. should start seeing items appear in that template_cache directory such as index_1.php, showthread_1.php etc.. if not you need to give this directory WRITE permissions (CHMOD 777)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #102  
Old 03-17-2006, 05:52 PM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this can use up alot of space huh?

Works well though... ! good job

/me clicks install
Reply With Quote
  #103  
Old 03-17-2006, 06:42 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scott MacVicar
Your best not to store it in eaccelerator manually as you will get overhead for the unserialize calls for a large template array, storing it in files is the best way.

You should be able to use $_templatedo so that you cache the correct set of action templates, though personally I would create a single global cache file with the ones present in global.php and then a script / action specific cache.

Regarding uncached templates, why not look through the value of $vbulletin->templatecache at the end of script execution.

I have several designs for a potentially better system if you want to investigate.
I havnt actually benchmarked any of the shared memory functions for serialization/unserialization speed but i dont believe the overhead is that great on 5.1+, i know the bug for 4.3.9 was fixed a while back; bug #31332 actually.

Hence the reason why I defaulted to to files at first; although there is stat call overhead which actually has been removed in cvs a while back.

This system definately needs to be further refined though, Ive managing many things at once.. so I still have a lot to do at once.
Reply With Quote
  #104  
Old 03-17-2006, 08:39 PM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
OK, cleaned up my post to make it make more sense.

Basically misc.php (for buddylist) and private.php (for private messages) are broken for me by this script. If I delete the private_36.php and misc_36.php (and so on) from the cache directory, they work OK, but then once cached again, they break once more.

Can I exclude these from being cached somehow?
same problem here..
Reply With Quote
  #105  
Old 03-17-2006, 09:17 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LBSources
same problem here..
Its not broken for me and I run a fairly clean install, so its obviously some modification that you guys have installed; please be more specific and not so vague

What modifications do you have on your forums?
Reply With Quote
  #106  
Old 03-17-2006, 09:24 PM
DementedMindz DementedMindz is offline
 
Join Date: Jan 2006
Posts: 1,474
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Trigunflame
Its not broken for me and I run a fairly clean install, so its obviously some modification that you guys have installed; please be more specific and not so vague

What modifications do you have on your forums?

i have alot of mods on my forum and it works great... just wondering if you ever plan on having it auto refresh the cache after so many days or doing a auto cache?
Reply With Quote
  #107  
Old 03-17-2006, 09:27 PM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont be so vague? lmao

ok .. plenty of hacks installed .. which is affecting or conflicting? i dont know..

may me and mini can compare which hacks we have and nail down a single one or few that we _both_ have installed
Reply With Quote
  #108  
Old 03-17-2006, 09:29 PM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BTW it doesnt seem to happen all the time.. atleast after deleting the private.php_XX file then it takes i guess some caching before it disappears again
Reply With Quote
  #109  
Old 03-17-2006, 09:29 PM
DementedMindz DementedMindz is offline
 
Join Date: Jan 2006
Posts: 1,474
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i noticed alot of the url rewrites mess this up if you have any of them installed
Reply With Quote
  #110  
Old 03-18-2006, 12:12 AM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DementedMindz
i noticed alot of the url rewrites mess this up if you have any of them installed
Hmm vbseo for example?
Reply With Quote
  #111  
Old 03-18-2006, 01:54 AM
DementedMindz DementedMindz is offline
 
Join Date: Jan 2006
Posts: 1,474
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tried this vRewrite - SEOed URLs for vBulletin which is hack https://vborg.vbsupport.ru/showthread.php?t=104484 and it really did a number i had to removed that in 5 mins
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 11:12 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
  • Page Generation 0.06075 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete