vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Template Cache System (https://vborg.vbsupport.ru/showthread.php?t=110144)

Trigunflame 03-11-2006 10:00 PM

Template Cache System
 
Vbulletin Template Cache System
Optimize Your Forums!!

https://vborg.vbsupport.ru/

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)


TCattitude 03-12-2006 11:57 AM

Sounds really nice, i will test it.
Install ;)

klaush 03-12-2006 12:03 PM

So me! Thanks!

MissKalunji 03-12-2006 12:03 PM

That means less server loads correct?

horseUSA 03-12-2006 12:04 PM

very nice sir!

Trigunflame 03-12-2006 12:06 PM

Quote:

Originally Posted by MissKalunji
That means less server loads correct?

Indeed, and thats always a good thing ;)

Trigunflame 03-12-2006 12:08 PM

Quote:

Originally Posted by horseUSA
very nice sir!

Thanks, its a small modification but it does help ;)

bashy 03-12-2006 12:13 PM

Well i have installed.....
Lets see what i can break now :o

Trigunflame 03-12-2006 12:16 PM

Quote:

Originally Posted by bashy
Well i have installed.....
Lets see what i can break now :o

I dont think it should break anything.. but then again things do happen.. I tested it with plugins, phrases, new templates etc.. and it worked fine for me...

It's really simple code so I don't think it has very large margin for errors..

MissKalunji 03-12-2006 12:26 PM

Quote:

Originally Posted by Trigunflame
Indeed, and thats always a good thing ;)


weeeeeeeeeeeeeee :banana: thanks! thats what i need :bunny:

Trigunflame 03-12-2006 01:19 PM

:), *hopes it hasnt broken anything* XD

Robru 03-12-2006 01:22 PM

Gets only blank pages after installed !

DementedMindz 03-12-2006 01:34 PM

cant download it .....Invalid Attachment specified. If you followed a valid link, please notify the administrator

Trigunflame 03-12-2006 01:34 PM

Quote:

Originally Posted by DementedMindz
cant download it .....Invalid Attachment specified. If you followed a valid link, please notify the administrator

Try again.

Robru 03-12-2006 01:49 PM

There are no files created in template_cache.
Using Windows 2003, chmod not nescesary, Only Read and Hide are checked out.

puertoblack2003 03-12-2006 01:52 PM

clicked installed,,,hmmm i guess it looks the same to me i guess have to wait ...great hack:bunny:

DementedMindz 03-12-2006 01:53 PM

so far 2 of the 3 installed and its a major improvement thanks :)

Trigunflame 03-12-2006 01:55 PM

Quote:

Originally Posted by Robru
There are no files created in template_cache.
Using Windows 2003, chmod not nescesary, Only Read and Hide are checked out.

Please follow the instructions.

The Realist 03-12-2006 02:12 PM

Installed and working 100%

Thanks M8 :)

Trigunflame 03-12-2006 02:13 PM

Note: There ARE no BUGS that prevent the page from showing.

Please make sure you follow the instructions to the Letter.

DementedMindz 03-12-2006 02:15 PM

i was wondering when i open the buddy list i get these... how can i cache them????
Uncached templates: BUDDYLIST (1)
Uncached templates: buddylistbit (2)

DementedMindz 03-12-2006 02:19 PM

also was wondering if it would be ok to put a index file in the cache this way no one can browse it?

Trigunflame 03-12-2006 02:22 PM

Quote:

Originally Posted by DementedMindz
also was wondering if it would be ok to put a index file in the cache this way no one can browse it?

Good idea

Trigunflame 03-12-2006 02:23 PM

Quote:

Originally Posted by DementedMindz
i was wondering when i open the buddy list i get these... how can i cache them????
Uncached templates: BUDDYLIST (1)
Uncached templates: buddylistbit (2)

What page is that exactly? Can you give me the filename?

DementedMindz 03-12-2006 02:24 PM

well i have it on the buddy pop up list in the navbar and when you click the vbshout.php?do=archive you get a bunch of uncached templates too

Trigunflame 03-12-2006 02:28 PM

Quote:

Originally Posted by DementedMindz
well i have it on the buddy pop up list in the navbar and when you click the vbshout.php?do=archive you get a bunch of uncached templates too

Ah these are action templates I believe, and they would differ from do=blah to do=this, i noticed this on the usercp page as well.

I might have to make some slight adjustments.

DementedMindz 03-12-2006 02:31 PM

that would be tight yeah i installed all 3... there is a major difference in speeds on loading now.... :)

puertoblack2003 03-12-2006 02:40 PM

to Trigunflame that template_cache directory we had to create i'm curious do we put any files in that directory? or is that what needs to be read for the hack to work...:)

vampireus 03-12-2006 02:41 PM

Installed :D It works great for me

DementedMindz 03-12-2006 02:44 PM

Quote:

Originally Posted by puertoblack2003
to Trigunflame that template_cache directory we had to create i'm curious do we put any files in that directory? or is that what needs to be read for the hack to work...:)


only thing i would put in there is a index.html this way no users can browse it.... but its used to store the cache files thats all

Trigunflame 03-12-2006 03:10 PM

Update:

Now caches all action templates.
The cache cleaner will not delete index.htm or index.html files.
Also updated the install.txt

PLEASE clear the template_cache directory, after you redo the modifications. The new changes cache the actiontemplates as well.

vampireus 03-12-2006 03:11 PM

Opps, now I have a problem, only get blank page on some

pm.php, private.php ... so far

P.S : posted it before check out the new update

Trigunflame 03-12-2006 03:12 PM

Quote:

Originally Posted by vampireus
Opps, now I have a problem, only get blank page on some

pm.php, private.php ... so far

Please download the new zip file and redo the code edits.. make sure thats not the problem. And clear that template_cache directory. The new file caches more stuff.

DementedMindz 03-12-2006 03:21 PM

how do we update it? is there code changes? or just clean cache and over write files and product?

Trigunflame 03-12-2006 03:22 PM

Quote:

Originally Posted by DementedMindz
how do we update it? is there code changes? or just clean cache and over write files and product?

Just redo the code edits from the install.txt file.

ps. the editor templates are still getting around the modification.. will have to make another minor change.. although ive only seen it affect the profile.php file as for now.

DementedMindz 03-12-2006 03:23 PM

ok thanks trying now :)

puertoblack2003 03-12-2006 03:25 PM

Quote:

Originally Posted by DementedMindz
only thing i would put in there is a index.html this way no users can browse it.... but its used to store the cache files thats all

ok thanks

buro9 03-12-2006 03:26 PM

Very nice as always Dusty.

One small thing to the action templates code:
PHP Code:

    // Cache All ActionTemplates
    
if (isset($actiontemplates)) {
      foreach (
$actiontemplates AS $k => $v) {
        
$globaltemplates array_merge($globaltemplates$actiontemplates[$k]);
      }
    } 

Some hacks haven't include the empty $actiontemplates array in their files... so using isset means that the script won't dribble a warning back to the output stream when that happens.

DementedMindz 03-12-2006 03:33 PM

ok i still get the uncached templates also when you go to clean the cache you get this

Parse error: parse error, unexpected T_VARIABLE in /admincp/template.php on line 85

and on that line is this

if ($f != '.' && $f != '..' && $f != 'index.htm' $f != 'index.html')

Trigunflame 03-12-2006 04:00 PM

Quote:

Originally Posted by DementedMindz
ok i still get the uncached templates also when you go to clean the cache you get this

Parse error: parse error, unexpected T_VARIABLE in /admincp/template.php on line 85

and on that line is this

if ($f != '.' && $f != '..' && $f != 'index.htm' $f != 'index.html')

change that to if ($f != '.' && $f != '..' && $f != 'index.htm' && $f != 'index.html')

ps. It cleaned up most of the action templates, but not all of em.. we'll see.

pss. whats ur forum url.


All times are GMT. The time now is 07:26 PM.

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.01449 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete