Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The torrents index page is actually slow to load and uses a lot of server resources, when loading the page, normally it runs around 100~ queries to generate the page, and another 100~ queries for every time you use the search bar (with 25 pagination).
If you double the pagination the amount of queries also double!
After this PR the page takes around 20~ queries to load the page. And this amount doesn't change if you increase the pagination.
I decided to leave the pagination the same as I was unsure if you wanted to increase this limit or not?
The same logic used to speed up the home page is used here.
Furthermore, I updated the movie database client to cache the data using any cache driver that laravel supports. Before you were forced to use redis, which I don't have on my local machine. (I can revert this if needed)