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)

orban 04-13-2006 10:00 PM

Plugin Based Template Cache
 
3.6 Thread for Support

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

PixelFx 04-14-2006 03:56 PM

sounds cool

Gizmo5h1t3 04-14-2006 04:14 PM

tried this, only concern is, as ppl browse the board, its adding files in the "templates" folder, of approx 250kb EACH...

is this a continuous thing, or does it clear itself after a while?
itll end up witrh the folder being massive??

**EDIT**

had this running for 10 minutes, and alreadfy the "template" folder is 6 mb in size????

MissKalunji 04-14-2006 04:24 PM

my question

how is it compare to this other guys template cache system hack?

MissKalunji 04-14-2006 05:08 PM

Quote:

Originally Posted by Gizmo5h1t3
tried this, only concern is, as ppl browse the board, its adding files in the "templates" folder, of approx 250kb EACH...

is this a continuous thing, or does it clear itself after a while?
itll end up witrh the folder being massive??

**EDIT**

had this running for 10 minutes, and alreadfy the "template" folder is 6 mb in size????


Thats normal...it saves each template

DementedMindz 04-14-2006 06:33 PM

i think i might try this one compared to the other one... i like how it clears out auto.. will check it out soon :) thanks... plus hes not even on no more and i dont think will be updating it

DementedMindz 04-14-2006 06:35 PM

ok another question when we Create a directory templates... now is there a way we could add a index.html or .php to it... as i think it wouldnt be to wise to have it open to public

MissKalunji 04-14-2006 07:25 PM

does it works for you?

DementedMindz 04-14-2006 08:38 PM

Quote:

Originally Posted by MissKalunji
does it works for you?

i didnt install it yet but im going to try it on my test board in a bit... you try it first :)... trying to make me the test dummy huh MissKalunji ????

MissKalunji 04-14-2006 10:17 PM

Quote:

Originally Posted by DementedMindz
i didnt install it yet but im going to try it on my test board in a bit... you try it first :)... trying to make me the test dummy huh MissKalunji ????

lol no *angel face* lol im gon try it

DementedMindz 04-14-2006 10:27 PM

yeah im going to after i watch this game.. but if you do it first let me know how it goes :)

MissKalunji 04-14-2006 10:39 PM

/me clicks installed and works well! very well! no error so far

orban 04-14-2006 11:26 PM

Quote:

Originally Posted by Gizmo5h1t3
had this running for 10 minutes, and alreadfy the "template" folder is 6 mb in size????

Well, it saves the all the templates used in one page, and if you have a lot of styles and templates it can easily get to 6mb. on my site with just the normal templates it goes to 3mb after a few hours.

Yes, it WILL stop eventually, when every possible page has been browsed to. It's normal that the files get created over time, because when you install it/clear the cache, it might take a while until a user goes to the FAQ page for example.

Quote:

Originally Posted by DementedMindz
ok another question when we Create a directory templates... now is there a way we could add a index.html or .php to it... as i think it wouldnt be to wise to have it open to public

You should disable directory browsing anyway. I'll exclude index.php/index.html from the files to be deleted in the next update.

Also it's really no problem to have these files public because they just define variables, no output anyway.


--


The worst thing that can happen is that it won't create any files, and even if that happens you won't notice any errors. :)

Kihon Kata 04-14-2006 11:28 PM

Installed! So, how big will the directory get? Mine is getting huge in 5 mins.

MissKalunji 04-15-2006 12:07 AM

the same size that your template has

orban 04-15-2006 08:20 AM

Quote:

Originally Posted by MissKalunji
the same size that your template has

Actually it gets bigger. It doesn't save every template to a file, but it saves collections of templates to files. For example showthread.php uses (1,2,3,45,67,123,234,454) then all those get saved to a file and then if you call showthread.php a second time those get included.

It shouldn't get bigger than 10-20mb though I'd say. If it does there's something wrong.

Gizmo5h1t3 04-15-2006 08:53 AM

mine went up to just short of 11 meg, then it cleaned itself out.......quality

orban 04-15-2006 09:19 AM

Well, did you edit/insert a template?

beebi 04-15-2006 11:07 AM

nice one

MissKalunji 04-15-2006 11:42 AM

Quote:

Originally Posted by orban
Actually it gets bigger. It doesn't save every template to a file, but it saves collections of templates to files. For example showthread.php uses (1,2,3,45,67,123,234,454) then all those get saved to a file and then if you call showthread.php a second time those get included.

It shouldn't get bigger than 10-20mb though I'd say. If it does there's something wrong.


you lost me a bit....

If you open showthread a second time...those get included???

orban 04-15-2006 01:51 PM

Quote:

Originally Posted by MissKalunji
you lost me a bit....

If you open showthread a second time...those get included???

Yes. The first time somebody opens showthread.php it grabs all the templates from the database and saves them to a file that is uniquely related to showthread.php. The second time somebody accesses showthread.php that file is include()ed (using that unique identifier) and there won't be any database calls.

MissKalunji 04-15-2006 01:59 PM

Ohhh ok i understand it works a bit differently then the other template cache from the other template cache hack probably why it doesnt do any errors like the other one

Thanks working fine! and my site is hacked to death!

orban 04-15-2006 02:05 PM

Quote:

Originally Posted by MissKalunji
Ohhh ok i understand it works a bit differently then the other template cache from the other template cache hack probably why it doesnt do any errors like the other one

Thanks working fine! and my site is hacked to death!

Yeah I think it does work different from the other one (also you don't have to edit any vB files).

Glad to hear it works for you :)

There is actually no reason it shouldn't work for any vB 3.5 installation, except that the directory can get quite big. But it saves RAM from the cached MySQL queries or something I guess. And hard drives cheaper than RAM. Not like I'll ever use my 150GB hard drive :D

Kihon Kata 04-15-2006 04:02 PM

FYI: Have had this running for one day and my templates directory is 14 megs.

We are a pretty busy site with 2,000 posts/day

Sped things up tho. I like this. Does it clean things up? of so, how and when?

orban 04-15-2006 04:08 PM

Quote:

Originally Posted by Kihon Kata
FYI: Have had this running for one day and my templates directory is 14 megs.

We are a pretty busy site with 2,000 posts/day

Sped things up tho. I like this. Does it clean things up? of so, how and when?

You can just delete it. "rm *" or something. If you want.

What do you mean by "cleaning" up? All of the files are used (even though some might be used very rarely), there is no garbage.

By the way I'm working on a plugin cache system too :) Without file modification of course.

Kihon Kata 04-15-2006 04:14 PM

^^ there Gizmo5h1t3 said "then it cleaned it self out"

Quote:

Originally Posted by orban
You can just delete it. "rm *" or something. If you want.

What does this mean?

BTW, I love this hack, it's working well. I don't really care that I have a 14 meg folder or a 150 meg folder. We are on a high speed dedicated server with a large HDD. :)

orban 04-15-2006 04:20 PM

Quote:

Originally Posted by Kihon Kata
^^ there Gizmo5h1t3 said "then it cleaned it self out"

The only script bit that "cleans out" the folder is when you insert/update a template, so most likely he (or somebody else in his admincp) did that.

Quote:

Originally Posted by Kihon Kata
Quote:

Originally Posted by Orban
"rm *"

What does this mean?

When you connect to your server with SSH you can change to the templates folder and remove all the files with "rm *". You can also delete them in your ftp program, but there's really no need to do that.

Quote:

Originally Posted by Kihon Kata
BTW, I love this hack, it's working well. I don't really care that I have a 14 meg folder or a 150 meg folder. We are on a high speed dedicated server with a large HDD. :)

I have the feeling too that it lowered the load a bit on our installation, but it's a bit hard to say tho. Great to hear it improved your performance then.

--

Is your whole site powered by vB? eg. global.php and all? that'd explain your 14mb cache folder. because I have only 4.1mb after 3 days.

Kihon Kata 04-15-2006 05:46 PM

Quote:

Originally Posted by orban
The only script bit that "cleans out" the folder is when you insert/update a template, so most likely he (or somebody else in his admincp) did that.



When you connect to your server with SSH you can change to the templates folder and remove all the files with "rm *". You can also delete them in your ftp program, but there's really no need to do that.



I have the feeling too that it lowered the load a bit on our installation, but it's a bit hard to say tho. Great to hear it improved your performance then.

--

Is your whole site powered by vB? eg. global.php and all? that'd explain your 14mb cache folder. because I have only 4.1mb after 3 days.

Thanks for the great support on your hack, nice to see the quick replies. Our site is semi vB powered with allot of hacks added on including vba gallery. lol We have completely custom coded beauty product review center and a beauty product swap center with wishlists etc. We have a large section outside our extremly modded up vB that isn't template driven but *IS* connected via global.php. I am assuming that since the only part of our site that is template driven is the forums, that this hack here only effects our forums. I'm also trying to figure out why it might be 14 megs, but really not too warried about it. We do cache php scripts plus we run MYSQL 4 caching

Maybe you can shed a little light or something. Thanks again for the hack

orban 04-15-2006 05:54 PM

vba gallery. product review and swap center...if it uses templates, might be the reason too.

you can open the files by the way, and just check what's inside, there's the names of the templates.

just check that the cache for the php scripts is large enough to hold all the template cache files.

DementedMindz 04-15-2006 07:21 PM

Quote:

Originally Posted by MissKalunji
Thanks working fine! and my site is hacked to death!

:banana: about time to have a nice working cache... works great thanks

MissKalunji 04-18-2006 03:21 AM

Quote:

Originally Posted by orban
Yeah I think it does work different from the other one (also you don't have to edit any vB files).

Glad to hear it works for you :)

There is actually no reason it shouldn't work for any vB 3.5 installation, except that the directory can get quite big. But it saves RAM from the cached MySQL queries or something I guess. And hard drives cheaper than RAM. Not like I'll ever use my 150GB hard drive :D

Yes and i thank you for that!

Quote:

Originally Posted by DementedMindz
:banana: about time to have a nice working cache... works great thanks

lol tell me about it!

DementedMindz 04-18-2006 11:21 AM

ok quick question will this cache every thread and all cause it seems like when i jump to a new thread it caches that.... am i correct on that?

orban 04-18-2006 11:23 AM

No?

It caches all the templates needed for showthread.php, one time, and that's it.

DementedMindz 04-18-2006 11:31 AM

also it would be nice if when updating a template only that one template was erased cause if not it will erase every template

orban 04-18-2006 06:16 PM

Quote:

Originally Posted by DementedMindz
also it would be nice if when updating a template only that one template was erased cause if not it will erase every template

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.

orban 04-18-2006 06:43 PM

I added template cache.beta.php. Read the green text on how to use that file.

Greatly improved the performance of my board.

MissKalunji 04-18-2006 07:15 PM

using the beta forum seems to be loading faster and 1 query less

orban 04-18-2006 07:17 PM

Are you using APC? And PHP 4 or 5? So I can make sure it works on different installations and put it out of beta.

MissKalunji 04-18-2006 07:23 PM

Quote:

Originally Posted by orban
Are you using APC? And PHP 4 or 5? So I can make sure it works on different installations and put it out of beta.

well i have zend optimizer and using php 4

MissKalunji 04-18-2006 07:34 PM

Oh one thing! my welcome panel isnt showing anymore.....


All times are GMT. The time now is 04:54 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.01565 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
  • (21)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