Here you could explore optimization parameters of the queue and learn how they influence Ajax requests. This example is a good start to learn about Ajax requests flood protection.

Pay attention to some points in the example:

- Setting ignoreDupResponces to true reduces the count of DOM updates on typing inside the input. (in initial state count of updates is equals to count of requests)
- Disabling the queue causes fully asynchronous updates. Note that updates could appear not only in direct order and as a result you could get wrong string.
- Setting request delay to greater value reduces the requests count on fast typing. (More similar requests are combined in the result)

Also pay your attention to the queue definition. As it is mentioned in our documentation (queue chapter in developer guide) such definition (inside some form without a name) means that the queue becomes global for the form.

Queue demo

Queue provides subset of common Ajax requests optimization attributes (requestDelay, ignoreDupResponse and timeout) which you could explore at section. These attributes defined within the queue are used for all request in case particular components do not override them.

The queue component also provides some additional attributes in order to control the queue itself:

- name attribute defines a name for the queue.
- disabled attribute allows to disable the queue. It could be used in order to disable the global queue for particular views or in order to switch between queues of the same name with different parameters.
- size defines the count of requests which could be queued at the moment. -1 value means that queue has no size limit.
- sizeExceededBehavior defines the behavior for the queue if size is already exceeded and a new request is tried to be added to the queue. (dropNew, dropNext, fireNew, fireNext values allowed)
- status attribute allows to point the status component to all requests from a particular queue.

Complete attributes table and ways of usage you could explore in our queue documentation (queue chapter in developer guide).

Note: queue component could get its parameters from EL bindings, but the component isn't designed to be updated via ajax requests. As there are no useful cases where the developers need to change the timeouts or request delays on the fly. Thus as you could see the example below uses h:commandButton in order to reebuild all the view and reinitialize the queue with new parameter values.