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

Query string caching overrides excluded pages from cache #4765

Open
6 tasks done
DahmaniAdame opened this issue Feb 25, 2022 · 2 comments · May be fixed by #4810
Open
6 tasks done

Query string caching overrides excluded pages from cache #4765

DahmaniAdame opened this issue Feb 25, 2022 · 2 comments · May be fixed by #4810

Comments

@DahmaniAdame
Copy link
Contributor

@DahmaniAdame DahmaniAdame commented Feb 25, 2022

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version 3.10.8
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
When a query string is set to be cached, it will be cached on pages excluded from caching as well.

To Reproduce
Steps to reproduce the behavior:

  1. Enable a specific query string to be cache
  2. Exclude a specific page from caching
  3. See that the page is cached when using the query string

Expected behavior
Page exclusions should be applied to query strings cache as well.

Screenshots
N/A

Additional context
N/A

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@Tabrisrp
Copy link
Contributor

@Tabrisrp Tabrisrp commented Mar 7, 2022

Reproduce the issue

Yes

Identify the root cause

This is happening because in the Buffer\Tests::can_process_uri() method, we are doing a match against the full request path including the query string, but the pattern uses the $ token to match end of line, so it's never matching against the excluded paths in the pattern.

Scope a solution

Instead of using get_clean_request_uri() as the subject in which to match, we can use get_request_uri_base(), which doesn't contain the query string.

Estimate the effort

Effort [XS]

@webtrainingwheels
Copy link

@webtrainingwheels webtrainingwheels commented Mar 11, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants