-
Notifications
You must be signed in to change notification settings - Fork 9
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
FEATURE: Add Setting queryParams|cookieParams.respect
to invert the control
#22
base: main
Are you sure you want to change the base?
FEATURE: Add Setting queryParams|cookieParams.respect
to invert the control
#22
Conversation
…t add cookies and arguments which affect the caching. which makes configuration much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by reading, i like this better than solutions via cookie name prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think allowedQueryParams
also should only be checked when respectedQueryParams
is empty and the respectedQueryParams
should become part of the generated identifier.
case (in_array($key, $this->ignoredQueryParams) && empty($this->respectedQueryParams)): | ||
$ignoredQueryParams[$key] = $value; | ||
break; | ||
case (!in_array($key, $this->respectedQueryParams) && empty($this->ignoredQueryParams)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a respected queryParameter should be added to $allowedQueryParams[$key]
as i would assume this to be part of the cache identity.
That imho would also mean that allowedQueryParams should only be checked when $this->respectedQueryParams is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mficzel How would you configure FullPageCache to not cache a search query in this case?
queryParams|cookieParams.respect
to invert the control
@sbruggmann I really like this change. Have you seen the comment by Martin? Would you be willing to finish this PR? |
added new options
cookieParams.respect
andqueryParams.respect
which work the opposite way the optionscookieParams.ignore
andqueryParams.ignore
do.this way we define in the settings which cookies and arguments really matter to our code.
all others don't affect the caching.
especially with tag managers and different tracking we have a lot of changing cookies and arguments which are only meant for the frontend and should never affect the code generation and caching.
we as developers should have the option to just allow known cookies and arguments, and ignore the rest.