[
https://issues.apache.org/jira/browse/TAPESTRY-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Onno Scheffers updated TAPESTRY-2364:
-------------------------------------
Attachment: TestFast.html
TestSlow.html
sayHello.js
To be honest, I didn't know it worked like this either and it seems to differ
per browser. On Firefox 3 (OSX) the effect is pretty obvious, even if you
include just one js-file at the end of the file. On other browsers the problems
start to show up only when more js-files are added to the end of the file (like
Tapestry does).
So some browsers are smarter and do immediately include cached resources, but
even they have to include the javascript files one after another, which still
takes many seconds with big libraries like Prototype and scipt.aculo.us.
Here's a test-case, using big images and external resources to make things more
apparent, tested in Firefox 3, Opera and Safari (OSX, Mac Pro 8-core). Opera is
the fastest, Firefox seems to be slowest.
- sayHello.js is a Javacript file that simply shows an alert-box when it gets
executed. It will be included in the two example pages.
- TestSlow.html is how Tapestry does it now. I added a couple of large images
on the page and included several external js-files to the end of the page. It
is most visible on first page-load (or after the cache is cleared). The
Javascript isn't executed until most of the resources are loaded or have
started loading.
- TestFast.html includes a couple of js-files in the HEAD section. The page
stays white a little longer, but the alert-box is shown immediately and before
the page renders.
> YSlow Recommendation: Write Scripts at bottom of page
> -----------------------------------------------------
>
> Key: TAPESTRY-2364
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2364
> Project: Tapestry
> Issue Type: Improvement
> Components: tapestry-core
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Minor
> Fix For: 5.0.12
>
> Attachments: sayHello.js, TestFast.html, TestSlow.html
>
>
> Tapestry is already doing a good job on this, by writing the dynamically
> generated <script> block at the bottom of the page, but the external scripts
> should also be down there.
> http://developer.yahoo.com/performance/rules.html#js_bottom
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]