| Author |
Working with component tree before render
|
Denis Oleshkevich
Greenhorn
Joined: Jul 19, 2012
Posts: 3
|
|
|
Hello, I need move all JS scripts from tag HEAD to bottom of tag BODY to increase a loading speed of application. How to do this? I trying solve this using PhaseListener, but can't understand how working with component tree from this scope.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14480
|
|
A lot of the renderers in JSF specifically and explicitly indicate what part of the generated HTML they will be output in, whether HEAD, body-start, body-end, or wherever. If you attempt to blindly override them you will probably not like the results.
The best way to increase the loading speed is to keep the content short, which doesn't require any messing around with JSF internals at all. In the case of user-requested JavaScript, making the scripts externally URL-referenced instead of in-line may help.
For some frameworks such as RichFaces, the server synthesises a client-specific script and uses the same script as an external URL reference for all of the client's RichFaces pages. So ensuring that this script is cached on the client can be a major performance boost. This isn't as easy as it seems, however, since some webapp servers such as Tomcat disable caching for secured items and have to be persuaded to re-enable caching.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: Working with component tree before render
|
|
|