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=113002)

vampireus 05-07-2006 03:55 AM

Quote:

Originally Posted by orban
normal login/logout or admincp/modcp login/logout?

Any PHP errors? Might be a problem with a PHP error that prevents cookies being set. Check your logs if possible. And are you still running 3.5.2? Maybe upgrade to 3.5.4.

I'm using vB 3.5.4. Now I get blank pages randomly after using the mod for a while. Clear the cache will fix it, no PHP errors.

orban 05-07-2006 08:28 AM

Has your board heavy traffic? Shared hosting? PHP version? Are you using a PHP cache?

vampireus 05-07-2006 07:45 PM

Yes my board has heavy traffic. Dedicated hosting. PHP 5.0.5. I'm using APC

DementedMindz 05-07-2006 07:46 PM

i have heavey traffic also with no problems at all and i have alot of mods installed..

orban 05-07-2006 07:49 PM

You *should* run PHP 5.1, PHP 5.0 is not recommended by PHP I think.

Blank page? That usually sounds like a parsing error or something. Can you check all the files in the templates/ folder if they are empty? Or somehow corrupted? APC cache too small?

FiX 05-07-2006 08:00 PM

I installed it without any problems, but it does not cache anything. The /templates folder ist chmode 777, but no files appear when browsing the forums

any ideas?

(yes it is enabled)

vampireus 05-08-2006 12:05 AM

I would like to upgrade PHP too, but my board's webmaster don't want to cuz the database is over 5GB.

Here is APC conifg, anything I should change? apc.max_file_size 1M is too small, maybe?

apc.cache_by_default On On
apc.enable_cli Off Off
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.max_file_size 1M 1M
apc.mmap_file_mask no value no value
apc.num_files_hint 1000 1000
apc.optimization Off Off
apc.shm_segments 1 1
apc.shm_size 64 64
apc.slam_defense Off Off
apc.ttl 0 0
apc.user_entries_hint 100 100
apc.user_ttl 0 0

Nothing's wrong with files in folder templates.

orban 05-08-2006 09:42 AM

Quote:

Originally Posted by FiX
I installed it without any problems, but it does not cache anything. The /templates folder ist chmode 777, but no files appear when browsing the forums

any ideas?

(yes it is enabled)

Mmhh, that's a tough one. Is the templates/ folder in your forums/ directory?

If you know PHP you could try to change the relative paths in the template_cache.php to absolule paths?

Running safe mode? Or SuEXEC PHP or something similar? Seems like it's a permission problem to be honest...

Quote:

Originally Posted by vampireus
I would like to upgrade PHP too, but my board's webmaster don't want to cuz the database is over 5GB.

Here is APC conifg, anything I should change? apc.max_file_size 1M is too small, maybe?

apc.cache_by_default On On
apc.enable_cli Off Off
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.max_file_size 1M 1M
apc.mmap_file_mask no value no value
apc.num_files_hint 1000 1000
apc.optimization Off Off
apc.shm_segments 1 1
apc.shm_size 64 64
apc.slam_defense Off Off
apc.ttl 0 0
apc.user_entries_hint 100 100
apc.user_ttl 0 0

Nothing's wrong with files in folder templates.

Mine is 64mb too and that's enough...hm. My max_file_size is 1mb too. What is the full http request on the blank page? Just "HTTP/1.x 200 OK" and "Content-Length: 0"? Or some error?

Do you log PHP errors to a file?

Coast to Coast 05-09-2006 10:17 PM

Installed for the Travel Adventures community

dbembibre 05-09-2006 11:11 PM

Is posible add a new param in ACP->Forum Options->Template cache to change the standard dir templates to another dir ??
I wont change the standard dir /forum/templates to another drive to gain in speed.

Another question, is recommended disable the vBulletin datastore cache with this hack or not ?

Excuse my broken English

orban 05-10-2006 08:21 AM

Quote:

Originally Posted by dbembibre
Is posible add a new param in ACP->Forum Options->Template cache to change the standard dir templates to another dir ??
I wont change the standard dir /forum/templates to another drive to gain in speed.

Another question, is recommended disable the vBulletin datastore cache with this hack or not ?

I am running it with vBulletin datastore cache and it works fine.

Uploaded a new version 1.0.3 with this option added. No other changes were made, if it's running fine for you there is no need to upgrade.

Kihon Kata 05-11-2006 02:53 AM

////////////// Hotm \\\\\\\\\\\\\\

MissKalunji 05-11-2006 03:47 AM

what its up? danm i'll be voting for that hack for sure!

orban 05-11-2006 01:32 PM

EoTM more like! Extension of the month! :D

Jafo232 05-11-2006 05:07 PM

Installed today. Have a site that gets some heavy traffic from time to time. Installed APC which speeds things up greatly, then installed your hack which made that sites forum fly.

Using the separate files option.

Does save the 1 mysql call per page as advertised.

CLICKED INSTALL.

orban 05-11-2006 05:27 PM

Happy to hear!

Benedict 05-11-2006 05:50 PM

Hello,

I love the idea of this mod :)

I have zend installed would you advise that I switch on the "Cache Templates Seperatly" feature

Many thanks

Ben

orban 05-11-2006 08:43 PM

I don't know, it depends on too many factors. Just try it out.

Living in music 05-14-2006 12:02 AM

i love it! Installed for my site ;)

HuangA 05-15-2006 06:06 AM

Quote:

Originally Posted by orban
Can't do that, because there is no way I can find out on what pages that template is used. The saved files aren't templates, they are collections of templates.

Can you at least make sure it doesn't delete the index.* pages? I've got it setup so that if anyone who tries to go there will be forwarded back to forum home and long and behold, it was deleted before I know it :X

DementedMindz 05-15-2006 07:14 AM

i dont have a problem at all wth it erasing my index.php file opps had it backwards my index.html

orban 05-15-2006 10:39 AM

It doesn't remove a index.html. I can add index.php to the list of files not to be removed if you want.

You can edit template_cache.php:105 to fix it right now.

There is no security problem with people accessing templates/ or even one of the files directly. The files are just

Code:

<?php
$variable = ".....alot of stuff.....";
?>

and nothing else.

goyo 05-15-2006 09:12 PM

Sounds great...unfortunately it's not compatible with Plugin Accelerator plugin. It screws up my main page (no shoutbox, weird who's online) when using them combined...

:cross-eyed: :tired:

Correction: even using it alone the shoutbox (vbshout) goes away :(

orban 05-15-2006 09:33 PM

Yes, you have to exclude FORUMHOME (I think?) when using it. Read the instructions ;) Or disable the save as seperate file option.

Can you link me the plugin acc plugin?

orban 05-16-2006 11:21 AM

You can nominate this extension by clicking "Nominate this mod" in the "Mod Options" section on this page. (For June I think.)

https://vborg.vbsupport.ru/showthread.php?t=115685

TECK 05-17-2006 12:58 AM

Quote:

Originally Posted by goyo
Sounds great...unfortunately it's not compatible with Plugin Accelerator plugin. It screws up my main page (no shoutbox, weird who's online) when using them combined...

:cross-eyed: :tired:

Correction: even using it alone the shoutbox (vbshout) goes away :(

Use eAccelerator. The mix between the 2 components rocks my vBulletin forums.

PennylessZ28 05-17-2006 01:25 AM

I tried to unistall this, it doesn't mix with the plugin accelator, now all my pages are blank white. I had to manually disable plugins, can't turn them back on or else.

orban 05-17-2006 08:51 AM

Quote:

Originally Posted by HR3rdGen
I tried to unistall this, it doesn't mix with the plugin accelator, now all my pages are blank white. I had to manually disable plugins, can't turn them back on or else.

Try to clear the templates/ folder and edit global.php and remove

Code:

cache_templates_with_file_cache($globaltemplates, $style['templatelist']);
$globaltemplates = array();

Can somebody link me that plugin accelerator? Is it the one that edits your .php files?

With all due respect, that's an awful hack.

MissKalunji 05-17-2006 12:01 PM

i like that hack its been working and speeding up my site :S why everyone complainning about it?

DementedMindz 05-17-2006 01:04 PM

Quote:

Originally Posted by orban
Can somebody link me that plugin accelerator? Is it the one that edits your .php files?

With all due respect, that's an awful hack.

here you go

https://vborg.vbsupport.ru/showthread.php?t=107315

TECK 05-17-2006 01:37 PM

While looking at the code fast ... Basically, the plugin accelerator writes all exististing installed plugins to files. Then, it reads TWICE(instead of once) ALL(instead of only the needed) newly created hook/plugin files, every time you access a forum page. In other words, you process a lot of unnecesary data. Since when reading many files in block is faster then reading a small piece of data from a database table? I might be wrong, since I only examined the class included in the plugin files... Feel free to comment on this, we are here to learn, not to put down other coders.

Why not just leave it the way it is made by vBulletin and install eAccelerator or APC?
eAccelerator, on top of caching the queries, it optimizes the PHP code also...

orban 05-17-2006 01:41 PM

Well, I see several problems with that addon, don't even know where to start. I would not recommend using that at all since it can essentially ++++ up your installation. What happens if you insert some bad code in for example the global hook? You can't even disable that addon anymore then. Then you have to make all your files world writable. I'll add a note that using this plugin is not recommended with this extension.

TECK: As far as I can see, the plugin accelerator plugin writes the plugins INTO the official vBulletin files INSTEAD of the hook calls. So you basically end up hacking the offcial vBulletin files. Meaning when something goes wrong you can reinstall vBulletin. The problem is that APC/eAcc doesn't cache eval().

What I DO recommend is when you're having a lot of plugins move the code to an external .php file and include that one at the global hook. I have a 20kb plugin.php with all my php code in it, I only add if's and function calls to the actual plugins.

MissKalunji 05-17-2006 02:31 PM

Quote:

Originally Posted by orban
Well, I see several problems with that addon, don't even know where to start. I would not recommend using that at all since it can essentially ++++ up your installation. What happens if you insert some bad code in for example the global hook? You can't even disable that addon anymore then. Then you have to make all your files world writable. I'll add a note that using this plugin is not recommended with this extension.

TECK: As far as I can see, the plugin accelerator plugin writes the plugins INTO the official vBulletin files INSTEAD of the hook calls. So you basically end up hacking the offcial vBulletin files. Meaning when something goes wrong you can reinstall vBulletin. The problem is that APC/eAcc doesn't cache eval().

What I DO recommend is when you're having a lot of plugins move the code to an external .php file and include that one at the global hook. I have a 20kb plugin.php with all my php code in it, I only add if's and function calls to the actual plugins.


Ive been using it with yours and everything seems fine


explain external.php ?

orban 05-17-2006 02:38 PM

Well just see this extension, instead of putting all the PHP code into a plugin I move it to template_cache.php and just add a few lines to the plugins.

dbembibre 05-17-2006 03:33 PM

Quote:

Originally Posted by orban
I am running it with vBulletin datastore cache and it works fine.

Uploaded a new version 1.0.3 with this option added. No other changes were made, if it's running fine for you there is no need to upgrade.

Thanks for the update Orban, your hack work really fine ;)
Thanks for your great job :)

MissKalunji 05-17-2006 03:44 PM

Quote:

Originally Posted by orban
Well just see this extension, instead of putting all the PHP code into a plugin I move it to template_cache.php and just add a few lines to the plugins.


oh ok *scratches head*

DementedMindz 05-17-2006 06:13 PM

Quote:

Originally Posted by MissKalunji
oh ok *scratches head*


me too :confused:

TECK 05-17-2006 07:10 PM

It's pretty easy.
He's having a master code static page, probably separated in functions.
Then, he calls the specific functions in plugin, with one line of code. Faster.

orban 05-17-2006 09:42 PM

Yes exactly.

MissKalunji 05-17-2006 09:43 PM

Quote:

Originally Posted by TECK
It's pretty easy.
He's having a master code static page, probably separated in functions.
Then, he calls the specific functions in plugin, with one line of code. Faster.


easy when you understand :confused: *feeling blond*


All times are GMT. The time now is 10:21 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.01700 seconds
  • Memory Usage 1,830KB
  • 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
  • (2)bbcode_code_printable
  • (13)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