vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Plugin Based Template Cache (https://vborg.vbsupport.ru/showthread.php?t=121876)

orban 01-10-2007 07:43 AM

I am using this with 3 styles.

Do you get any php errors when switching styles? Check your logs :) White page usually means errors.

orban 01-12-2007 04:25 PM

Removed this post on author's request.

amcd 01-12-2007 04:35 PM

orban, can you briefly explain how/why this new experimental one is better than the released product?

orban 01-12-2007 04:42 PM

Well, the old one used the following "hack" for the template evals:

eval('$navbar = include("templates/1234.php");');

And that only for larger templates. Smaller ones (default setting 4500 bytes I think) were still executed the old way (even if stored in a file).

This one, however, takes a different approach.

eval('$navbar = template_1234($spacer_open, $stylevar, $GLOBALS, $welcomeheaders)');

All templates are parsed and stored in functions, and all "template function" for one page are stored in a file.

So basically all eval()s only execute a function call. This means all eval calls are nearly completely avoided, and there is just one file for every page. The files aren't too big on disk (40-100kb) but up to 2.5mb in xcache which isn't an issue though so far (I think this is because vB compiles all templates as one very long string with <if> calls being ternary conditionals).

thincom2000 01-12-2007 09:37 PM

Yeah, I noticed coding one of my plugins that using a bunch of eval()s really slows things down. I ended up rewriting the code 3 times before I came up with a way that didn't use a more than one eval() on runtime.

Thanks for the update!

thincom2000 01-18-2007 11:41 AM

What could be causing fatal undefined function errors when using the experimental code?

orban 01-18-2007 11:46 AM

That the file doesn't get included, have you created a writable cache/ folder?

amcd 01-18-2007 12:47 PM

That's really great thinking, orban. What is stopping you from making this the default method?

orban 01-18-2007 02:22 PM

Well, you can't easily "exclude" templates like in the default method so all addons that dynamically modify templates on run time will break and it's mostly untested. :)

But yeah I might release it as a second option.

thincom2000 01-18-2007 02:58 PM

Quote:

Originally Posted by orban (Post 1162109)
That the file doesn't get included, have you created a writable cache/ folder?

Yes, it is only happening on some pages. I am thinking it is an issue with those pages, but I don't really know what to look for.

I reverted to the default method to "fix" the issue.

ociosos 01-18-2007 06:11 PM

it is really nice hack....
but it is not VBADVANCED CMPS Friendly :(

having some issues with it :(

amcd 01-18-2007 07:31 PM

Installed the 'experimental' stuff on my live board. Its running fine so far. xcache does not show any discernible increase in memory consumption.

orban 01-20-2007 09:41 AM

Quote:

Originally Posted by thincom2000 (Post 1162247)
Yes, it is only happening on some pages. I am thinking it is an issue with those pages, but I don't really know what to look for.

I reverted to the default method to "fix" the issue.

Are you using a lot of custom templates?

Try to turn on debug mode and see if there are any uncached templates, those might causing the issue.

I could write some additional checks (which I will for sure if I ever make this thing "stable").

Quote:

Originally Posted by ociosos (Post 1162359)
it is really nice hack....
but it is not VBADVANCED CMPS Friendly :(

having some issues with it :(

Are you using the experimental one?

If not, try to set the full path to the templates folder in the admincp under Plugin Based Template Cache options.

Quote:

Originally Posted by amcd (Post 1162421)
Installed the 'experimental' stuff on my live board. Its running fine so far. xcache does not show any discernible increase in memory consumption.

Cool, glad to hear :)

ociosos 01-20-2007 07:49 PM

i got it to work now!!!!
lol
thank you :p

excellent HACK recomended!!!

I click INSTALL

THANK YOU!!!! again!!!

taibahost 01-28-2007 02:30 PM

nise thank you

taibahost

Zia 02-09-2007 04:32 PM

Orban,

maybe i will go a bit out of track from this hack..

here this hack works fine with APC or eAcclerator..
i have read in vb.com using this hack.. cached script will be increased

atm we are using eAcclerator , soon we move to Xcache..
and this hack will work with Xcahce too ? right?

amcd 02-09-2007 04:36 PM

Yes, it works fine with xcache, even with the optimizer turned on.

orban 02-09-2007 04:39 PM

Yeah I'm using it with xcache.

Zia 02-10-2007 04:31 AM

nice to know...

can u tell me few more thing
if we allow 32Mb of Ram and if its filled up with cached script...what will happen next ?
and (i read at vb.com)Xcache's performance is better than APC & eAcclereator ?

M-Tuning 02-10-2007 05:44 PM

Installed it, Serverload went from 5 to 2 at the moment,

With eAccelerator installed

M-Tuning 02-11-2007 09:02 AM

I found a "bug", the quickreply doesn't work anymore,
The message is posted but you can't see it after you posted it.
You see it after you press F5 though.

orban 02-11-2007 11:54 AM

Are you using any addons that modify the quickreply behavior?

M-Tuning 02-11-2007 06:06 PM

I believe not, but it does work with other styles,
which template does the ajax quickreply thing?

Bulent Tekcan 02-11-2007 09:51 PM

Quote:

Originally Posted by m-tuning (Post 1180059)
I believe not, but it does work with other styles,
which template does the ajax quickreply thing?

I have been using this plugin since 6-7 months without any problem.Also our boards realy under heavy traffic and also list in bigboards.

Are you use mod_security ? If you use this module check your conf. because some POST action hang on quickreply screen.

M-Tuning 02-12-2007 02:25 PM

I solved the problem, I reverted the Template and added my mods to it.

And know it works :P

Mudvayne 02-20-2007 06:22 PM

Installed again & also nominated for MOTM :).

Xplorer4x4 03-03-2007 05:27 PM

My forums are in the root folder so I have put templates folder into the root directory. For soem reason this will only cache my templates into my forums/server root and not /templates.

Any idea why this might be happening?

orban 03-03-2007 08:22 PM

Have you tried setting the full path in the options?

Xplorer4x4 03-04-2007 03:01 AM

Quote:

Originally Posted by orban (Post 1195074)
Have you tried setting the full path in the options?

Yes I tried /home/name/www/templates and /home/name/public_html/templates and it still writes to the root.

Frames 03-05-2007 10:19 AM

Hi,

I install with Cache Templates Seperately (I have APC)

¿Is normal the templates folder is empty?

¿Are all files cached in APC?

thanks

orban 03-05-2007 10:23 AM

No, the templates folder is not supposed to be empty.

Have you set the correct permissions for the templates folder?

Xplorer4x4 03-05-2007 11:43 AM

Quote:

Originally Posted by orban (Post 1196107)
No, the templates folder is not supposed to be empty.

Have you set the correct permissions for the templates folder?

I have chmodded my folder to 777 but it refuses to write there. Only to the root.

Frames 03-07-2007 12:40 AM

I can see all the templates now, I have 1 DB Server an 5 www servers, maybe this is the cause, I install in one server and update the pluggin options in the others.

Nominated Pluggin! very good for big forums!

Do you have some plugin to cache the home and forumdisplay, and update every 5 minuts?

thanks!

pd: if you are interested to work modding vbulleting please send me a private message

Xplorer4x4 03-07-2007 12:37 PM

Also my templates do not update after i edit them unless i disable this, even if i clear my browsers cache.

da420 03-07-2007 04:37 PM

Quote:

Originally Posted by Xplorer4x4 (Post 1197941)
Also my templates do not update after i edit them unless i disable this, even if i clear my browsers cache.

This happens to me sometimes too.

When I go into make template edits I just disable this modification. Then once I am done, I re-enable it, and alls well....

Xplorer4x4 03-07-2007 04:43 PM

Quote:

Originally Posted by da420 (Post 1198144)
This happens to me sometimes too.

When I go into make template edits I just disable this modification. Then once I am done, I re-enable it, and alls well....

I tried this to but when i turn it back on, the edit is still in the HTML of the template but does not show up.

orban 03-07-2007 04:45 PM

You can always just clear the templates folder manually.

Xplorer4x4 03-07-2007 04:50 PM

Well my templates wont cache to any where but the forum root but i delete all the files related to this cache system and the templates still do not update.

thincom2000 03-07-2007 05:43 PM

If you are using the experimental version, then yes, you have to clear the folder manually. If you are using the stable version, however, it should automatically clear whenever a page in the AdminCP loads (I believe it uses the admin_global hook).

Xplorer4x4 03-07-2007 05:51 PM

I am using 1.0.3


All times are GMT. The time now is 12:20 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.01677 seconds
  • Memory Usage 1,812KB
  • 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
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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