It takes to long for the server to respond to the query. Part of the problem is running the data through a Laravel API Resource to restrict what data is delivered.
I am already using eager loading to improve the speed of the query and have used explain to ensure that it is efficient. The database is well indexed and running Aurora DB from AWS.
I have tried using Redis for caching but the possible permutations of filtering, sorting and paginating the data make it seem impractical. I wasn't able to get good results with this as warming the cache for all variations isn't possible. And because the user preferences for sorting and filtering are stored locally in the browser there isn't a simple default state to warm the cache for either.