Feature #44194
openCache user mention autocomplete responses to reduce redundant requests
Description
This patch improves user mention autocomplete by reusing recent autocomplete responses on the client side. It reduces unnecessary requests to the server, particularly when an autocomplete query has already been shown to have no matches.
Currently, when a user types several characters after "@", Redmine sends consecutive requests to the server to fetch users for the autocomplete suggestions. In environments with many users, each request may take several seconds to query the database. When many requests are sent in quick succession, this can increase server load.
This patch keeps the most recent autocomplete response in a small client-side cache. If the cached response is empty and the current query extends the cached query, the cached empty response is reused without sending another request. For example, if a request for "@jan" returned no matches, subsequent queries such as "@jane" and "@janet" are handled entirely on the client side because no matches can exist for those queries when none exist for "@jan". The cache is also reused when the same query is evaluated again.
Files
No data to display