I have the following problem, I have a report screen that makes an Ajax call that returns all items to me. However when the report has few records it returns everything correctly, Ajax makes the request receives the information and plays on the screen. However, when the query returns more than 13,000 records, the method is time-consuming, and Ajax stays for a few minutes processing, then the 500 or 502 error occurs. When I use Debug in the method passing the same Ajax parameters, the method takes a while to execute due to the number of records, however the method reaches the end, already running in the browser it dies and gives the error 500 or 502.
Does anyone have any workarounds?