[pmwiki-users] Question regarding slow page loading with attr set

Petko Yotov 5ko at 5ko.fr
Sat Apr 13 12:09:31 PDT 2024


Added caching for (:if auth level pn:) for 2.3.33, you can get it from 
ChangeLog or Subversion.

On my wiki, it didn't seem to help until I realized that one of the 
conditionals I had was 'edit' (in SideBar), the other one 'upload' (in 
PageActions), so it is expected to call RetrieveAuthPage again. There 
may be room for improvement, but for another day.

Petko


On 13/04/2024 19:49, Hans Bracker wrote:
> Hello Petko,
> 
>> Authentication conditionals are not fully cached, and the conditional 
>> markup calls RetrieveAuthPage() which actually opens the disk file for 
>> the target page (in this case the current page), and reads the page 
>> text and metadata (but not the whole history) then checks the session 
>> passwords against the "passwdedit" attributes.
> 
> thanks for the reply and explanations!
> Yes, I dug down and found that auth calls to function CondText2 makes
> the page load slow, if there is a password attribute stored in it,
> otherwise not.
> On my local machine each (:if auth ...:) markup call will take 0.43
> secs, if we have  a password attribute set in the page.
> I put Stopwatch calls into the CondText2 function, and with pmwiki
> skin, and page actions and sidebar disabled in the skin tmpl, and a
> page with just three (:if auth ..:) conditionals, I get:
> 
> 0: 00.00 MarkupToHTML begin
> 1: 00.00 CondText2 called
> 2: 00.42 CondText2 after auth
> 3: 00.42 CondText2 called
> 4: 00.85 CondText2 after auth
> 5: 00.85 CondText2 called
> 6: 01.27 CondText2 after auth
> 7: 01.28 MarkupToHTML end
> 8: 01.28 now
> 
> same page without password attributes I get:
> 
> 0: 00.00 MarkupToHTML begin
> 1: 00.00 CondText2 called
> 2: 00.00 CondText2 after auth
> 3: 00.00 CondText2 called
> 4: 00.00 CondText2 after auth
> 5: 00.00 CondText2 called
> 6: 00.00 CondText2 after auth
> 7: 00.00 MarkupToHTML end
> 8: 00.00 now
> 
> Caching  of  results of (:if auth...:) per $pagename and per $level
> may be nice, yes!
> What got me onto this today was a test with introducing a new auth
> level I called 'post', to give a visitor authentication to do Fox
> posting to a page, without giving full edit access. And it struck me
> that the whole page loading went up to five seconds! Because of many
> conditional (:if auth... :) directives!
> 
> I was building csv data tables with conditionally showing an edit and
> delete button for each row, via an automatic or custom template.
> So if the page got password attributes set, then the page load time
> can be catastrophic!
> 
> Thanks for looking into this!
> 
> Cheers,
> Hans



More information about the pmwiki-users mailing list