Delay when fetching data from headless-admin-user/v1.0/user-accounts for the first time after server restart


  • When running a REST API call as below:
    Portal users and administrators may observe slowness after a server restart. The slowness will increase as the number of users to fetch will grow. After the first delay, subsequent fetch calls will be faster.


  • Liferay DXP 7.1+


  • The observed behavior is intended, as Liferay clears the database cache after a server restart.

  • One approach to handle the issue is through a cache "warm-up" mechanism. To elaborate more, upon restarting the server:

    1. Setup a crawler or jmeter script that runs the concerned query / visits the page where the datatable portlet is present so the query runs.
    2. Once the server is restarted and while the traffic is not routed to the server (e.g.:  the load balancer does not send any traffic yet), run the script to visit the pages directly on the node.
    3. Enable traffic routing to the server.

  • Please note, the above method is untested and only provided as a hint. As it pertains to the domain of customizations, the ability of Liferay Support to assist with it is limited.