Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 09:16:42 AM

Pages: [1]   Go Down
  Print  
Author Topic: Template caching with phpbb 2.0.13  (Read 776 times)
fretnmore
Grandma Looney
Über Jedi
*****
Offline Offline

Posts: 2863



WWW
« on: March 03, 2005, 07:35:09 AM »

I'm still a newbie at all of this php stuff so please bear in mind that I am currently high on having successfully updated my forum to 2.0.13

But now I have a question....they included with this update a method of template cacheing which is supposed to cut down on server load - but then they confused me with two options of implementing.

Which is best to use at LP, the flat file cacheing or the database system?

Thanks for any advice/opinions you can give me.
Logged

Life is not measured by the number of breaths we take, but by the moments that take our breath away.
----------------------------------------------------------
Tri-Wolf Studios
Lunarpages Web Hosting
Lunarpages Forums
Lunarpages Affiliate Program
Milton
MR-Disabled
Über Jedi
*
Offline Offline

Posts: 2267


« Reply #1 on: March 03, 2005, 07:55:36 AM »

Do you have a link to a page that explains this? I pretty sure I know what you're talking about, but I'd like to read more before I answer.
Logged

fretnmore
Grandma Looney
Über Jedi
*****
Offline Offline

Posts: 2863



WWW
« Reply #2 on: March 03, 2005, 08:12:49 AM »

Couldn't find it quickly on the phpbb.com site, but this is the documentation that came with the changed files download. This information is in the contrib folder
Quote
Template cacheing

Authors: Crimsonbane, psoTFX and nathan

File Caching Updated

During development of phpBB2 a recurring issue of server load has cropped up. phpBB 2.0.0 differs from many of its contemporaries by doing many more tasks at runtime. While this allows for simpler upgrade and modification paths it also leads to a greater strain being placed on the server. To help reduce this issue a cacheing template system was created based on work by Crimsonbane. This stores a compiled version of each template resulting in a generally significant reduction in server load and perhaps page generation time.

Two versions of the cacheing system are contained in this directory, one uses flat files the other a MySQL database. Testing has shown that, in general, the average virtual host seems to show better performance with the flat file solution. However this may not be the case for your system, so please feel free to try both.

In both cases you need to rename your existing template.php script (in includes/) and replace it with whichever template_*.php you want to try.
template_file_cache.php

To use the flat file system you need to create a directory called 'cache' in your phpBB root directory (it may already exist and contain some default files, do not delete these). This directory must be writeable by the web server, e.g. global write access. Under UNIX systems this is typically achieved by using chmod a+w cache or chmod 777 cache. Many FTP applications also allow you to change permission properties. See your applications manual for details on how to do this.

Please note that creating a world writeable directory is of course a potential security issue. Most of the time this is not a great issue, however on virtual hosting accounts there may be users who have nothing better to do than cause problems. Therefore you should monitor the status of this directory regularly and report any problems to your hosting provider (who will be in a position to take action against any offending user).

NB: The directory required for this version of the file caching template system differs from previous releases. You can safely delete the old caching directories.
template_db_cache.php

To use the database system (note that this is only compatible with MySQL at present) you need to create the following table (replacing the phpbb_ prefix with your own if you used something different):

CREATE TABLE phpbb_template_cache (
  template_name char(255) NOT NULL default '',
  template_handle char(50) NOT NULL default '',
  template_cached int(11) NOT NULL default '0',
  template_echo tinyint(1) NOT NULL default '1',
  template_compile text NOT NULL,
  PRIMARY KEY  (template_name)
)

These files should not be incorporated into any mod or other plug-in, etc. They have been tested quite thoroughly but we cannot guarantee their stability in all cases. The system is based on work by Crimsonbane and of course Nathan's original templating system.


And that is absolutely all of the information that I have on it.
Logged

Life is not measured by the number of breaths we take, but by the moments that take our breath away.
----------------------------------------------------------
Tri-Wolf Studios
Lunarpages Web Hosting
Lunarpages Forums
Lunarpages Affiliate Program
Milton
MR-Disabled
Über Jedi
*
Offline Offline

Posts: 2267


« Reply #3 on: March 03, 2005, 08:23:13 AM »

Actually, it isn't what I thought it was going to be, so I have no idea.  Embarassed

I suggest trying it both ways to see if you notice better performance with one setup over the other.
Logged

Danielle
Guest
« Reply #4 on: March 03, 2005, 08:26:02 AM »

I would say that they encourage the flatfile one by indicating is it the least intensive, so if you are looking into which to use for cutting down on load, it appears based on what they are saying that it would be less intensive.  I do not know anyone using this method to determine if what they say is the case or not.

The flat file one concerns me, however, due to it being files on the account itself, which are then open to being hacked and your information might then be compromised.  As the MySQL system to do it instead would be less a security risk (even if more intensive than the flat file one), I would myself go with it.  I would wonder, though, if adding this caching using MySQL will simply have similarity of load to not having it at all (or how many queries you would run using this in comparison to not using it).

Basically, either of them has risks (security for the flat file which will not be in the database but files on the account; queries increased or load being the same for the MySQL one as well as increasing the size of the database itself), so whichever you choose you would have to decide which ones you prefer to take.  Otherwise, simply don't use it.  If your forum isn't that active and you do not have a lot of mods, I am not certain you would need to use this or not.

Sorry if that might not have been helpful, but that is how I see the choices available Smile
Logged
fretnmore
Grandma Looney
Über Jedi
*****
Offline Offline

Posts: 2863



WWW
« Reply #5 on: March 03, 2005, 08:29:03 AM »

And therein lies the problem. My board isn't that active that I think it would be really noticeable. Although I would like to do whatever I can to keep server load down. Which was why I need advice.

Add to the above that I am leaving on a three week vacation this week end and I don't have time to experiment right now. So, if anyone should experiment, please post here so I can see what you found out.....please?

/me does not like being on the bleeding edge of anything - translation = "chicken"
Logged

Life is not measured by the number of breaths we take, but by the moments that take our breath away.
----------------------------------------------------------
Tri-Wolf Studios
Lunarpages Web Hosting
Lunarpages Forums
Lunarpages Affiliate Program
fretnmore
Grandma Looney
Über Jedi
*****
Offline Offline

Posts: 2863



WWW
« Reply #6 on: March 03, 2005, 08:32:44 AM »

Thanks Danielle - that was kind of the way I was leaning. Without a definitive answer to it all, my best bet is to not implement it at all. As I stated above - I don't like being amongst the first to try stuff. Cause I'm not sure I could fix it easily if it all went wrong. So, I will hold off.

But, if anyone should figure out that one way is definitely better than another, and at what point it becomes a real help to do this...it might help not only me but a lot of folks here at LP that are using phpbb.
Logged

Life is not measured by the number of breaths we take, but by the moments that take our breath away.
----------------------------------------------------------
Tri-Wolf Studios
Lunarpages Web Hosting
Lunarpages Forums
Lunarpages Affiliate Program
Pages: [1]   Go Up
  Print  
 
Jump to: