-
1. Re: Tips for a4j:poll? Web app taking up lots of CPU and me
sergeysmirnov May 3, 2007 9:29 PM (in response to zzzz8)Using poll component should have a practical reason for application in run-time. a4j:poll produces a regular JSF Request including session restoring and JSF lifecycle processing.
So, the first tip:
do not use a4j:poll (or bunch of them) just make your life as a developer easy, but future live of server software and hardware hard
Ajax4jsf presumes that developers use chain: event - request - server action - response - update
This guaranties there is a reason for request (event occurs) and reason to update (as soon as model changes).
Others:
use own form for each poll component to avoid sending extra data to the client.
use ajaxSingle="true" for a4j:poll if you do not post any other data from the client to server during the poll request.
limit the region for processing with < a4j region >. If ajaxSingle limits what will be sending from the client, region limits what will be processed on the server
use as shortest scope for involved in the processing beans as possible. It does not mean session or conversation scope are not OK. Think why it is important to involve them.
do not re-render wide zones on the view . Limit then to what might be changed as a result of this particular requests.
use limitOnList="true" and point the to components you want to re-render explicitly.
try to avoid crossing between -re-rendering zone between different polls and event-driven changes.