-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to cache paginated urls? #97
Comments
@hmzisb the issue is that Laravel uses a query string for pagination. I did see a solution for caching views that have query string parameters, but I don't particularly like this because a bot could generate a huge number of cached files by just changing the query string slightly each time. The solution I used was to implement pretty pagination - that is where the page number forms part of the route, rather than using a query string. I used this package: https://github.com/michaloravec/laravel-paginateroute So your URLs become |
@1stwebdesigns Thanks for the help. I saw this package but it seems like it hasn't been maintained in the last three years. Does it still work with the latest version of laravel? |
@hmzisb Yes it works fine - although it was created 3 years ago I have seen the author reference it on the Laravel forum more recently. In my case it was a choice between disabling the caching of paginated pages, implementing a work-around to cache pages with query strings, or implement pretty pagination. The latter seemed the lesser of 3 evils. Not to mention I think pretty pagination looks nicer, so there is a benefit there. |
Paginated pages return the same content as first page. As there any way around it?
The text was updated successfully, but these errors were encountered: