Author |
Message |
Vendethiel Board Member
Joined: 26 Oct 2014
Posts: 251
|
Posted: 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) |
|
Back to top |
|
|
nostro Board Member
Joined: 16 Jul 2012
Posts: 54
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
Posted: 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 |
|
|
|