Skip to content
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

Pagination links are incorrectly cached when the website has multiple domains #407

Open
Drewdan opened this issue Jul 27, 2021 · 0 comments

Comments

@Drewdan
Copy link

Drewdan commented Jul 27, 2021

Describe the bug

If you have a website which has multiple domains, and subsequently multiple sessions, you might visit a page showing paginated resources, and the class which has the pagination data, such as the path for the links is cached. This means the baseURL for the pagination links is also cached, and won't change when the URL of the website changes.

For example:
go to mywebsite.com - and load a page with paginated data - the links will show with the correct URL
process to mywebsite.app - and loads the same page with paginated data - the links will show with the previous URL, not the current one.

Eloquent Query
Please provide the complete eloquent query that caused the bug, for example:

User::paginate();

Stack Trace
N.A

Environment

  • PHP: 7.4
  • OS: Windows 10, Ubuntu 20.04 (WSL) and AWS Llambdas
  • Laravel: 8.36.2
  • Model Caching 0.11.1

Additional context

This behaviour is not too unpleasant and quite edge casey, however, it does get confusing when a pagination link changes your domain from one to another, and then you lose your session.

I have a fix in mind, and the PR will follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant