[dokuwiki] Re: Performance: scripts at the bottom?

  • From: Colin McKinnon <colin.mckinnon@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 24 May 2013 17:31:44 +0100


Thanks for the feedback - even though it's not a solution on a plate, it's
helpful to see stuff from other peoples' perspectives.

There's certainly a clear performance benefit - as per my original post,
with both Firefox and Chrome running on the same machine as
Apache/mod_php/apc, time for page to appear for pre-generated (i.e.
serverside cached) pages is around 1.5-2 seconds (with window.onload firing
approx 300msec later).

Just to confuse things further....

- one other solution I was thinking about was using pjax (
https://github.com/defunkt/jquery-pjax ) to just replace the page-specific
content instead of reloading the entire HTML / reparsing the CSS and
Javascript. Hence after the first page load, it doesn't matter if the
javascript is at the top or the bottom. But I don't know how well this
handles things like rendering triggers. And there's the problem of plugins
injecting additional script tags, potentially leading to memory leaks.
Using an internal message queue is a neat way to solve this (and scripts at
the bottom). But I don't know that plugin developers would necessarily jump
on a bandwagon without a very clearly defined destination and driver.

- indeed, looking at some of the javascript-enabled plugins, a common
feature is that they will likely break any strict content security policy
by using inline code in script tags. i.e. there's certainly benefits other
than just performance in placing structures and controls around how people
develop the javascript side of plugins.

I guess I need to spend a bit more time thinking about this.

On 24 May 2013 13:58, Anika Henke <anika@xxxxxxxxxxxxxxx> wrote:
> This has been discussed before, although mainly in the IRC. Here is the
> appropriate (closed) feature request:
> https://bugs.dokuwiki.org/**index.php?do=details&task_id=**2544<https://bugs.dokuwiki.org/index.php?do=details&task_id=2544>
> Please feel free to add to that. It would be great to have some proper
> data proving or disproving the case for JS at the bottom (specifically for
> DokuWiki).
> Cheers,
> Anika
> C.
> --
> DokuWiki mailing list - more info at
> http://www.dokuwiki.org/**mailinglist<http://www.dokuwiki.org/mailinglist>


Other related posts: