[webui] move the query for requests into a function and cache it