phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Question about performance improvements to viewtopic.php

Goto page Previous  1, 2
 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 251



PostPosted: Sat Nov 01, 2014 1:24 pm 
Post subject: Re: Question about performance improvements to viewtopic.php

For the topic_views, I think I've seen a guy use a rand(0, 3) to only update the table once every 3 views (and add the according number of views) icon_smile.gif
Back to top
nostro
Board Member



Joined: 16 Jul 2012

Posts: 54


flag
PostPosted: Sat Nov 01, 2014 1:31 pm 
Post subject: Re: Question about performance improvements to viewtopic.php

That's from the "Tweaks for large forums" thread at phpbb.com, I was using that hack until now, but using a separate temporary table seems a bit better.
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Sun Nov 02, 2014 11:35 am 
Post subject: Re: Question about performance improvements to viewtopic.php

nostro wrote:
So you cache the forum permissions for every user, right? Would that be a problem for a board with many users or many forums?

It's not a global cache, it's a local cache. I believe phpBB3 does something similar.

A global cache makes sense for something like $board_config as it's used by everyone. So I write that data (which changes very slowly, if at all) to a physical file and use an include to bring it in. It's the same for everyone.

The user security profile is basically a list of forums, right? I add that to the user table so when I do a "select * from phpbb_users" I get not only the user data but their security permissions and preferences as well. (If you remember on this board you have the option to turn of forums that you don't want to see, even if you are authorized to see them.) By doing that, I skip querying the user_groups and other permissions-related tables. Since this is stored on the phpbb_users table it's essentially a "local" cache of the user security profile, and it's unique to every user, including "Guest." The main issue to think about next is how you can "expire" or invalidate this cached security profile if (when) new forums are added or security permissions are changed.

I went back and checked the raw source for 2.0.23 and you're right; the check for security "is auth" in the function make_jumpbox is commented out! That just seems wrong. I use security + profile settings in my code.

_________________
phpBBDoctor Blog
Back to top
nostro
Board Member



Joined: 16 Jul 2012

Posts: 54


flag
PostPosted: Mon Nov 03, 2014 3:29 am 
Post subject: Re: Question about performance improvements to viewtopic.php

Thanks, looks good to me, I'll try to cache permissions.

Didn't know about the hide forums feature, nice one!
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Sat Nov 15, 2014 2:14 am 
Post subject: Re: Question about performance improvements to viewtopic.php

I'll have a bit more to comment later - but the jumpbox was a problem for us which we had to swiftly deal with.
_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 2 of 2 All times are GMT - 4 Hours
Goto page Previous  1, 2
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0393 seconds using 16 queries. (SQL 0.0081 Parse 0.0006 Other 0.0307)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo