-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,22 @@ Flowpack: | |
cookieParams: | ||
# ignored cookie params exclude cookies that are handled by the frontend | ||
# and are not relevant for the backend. A usecase would be gdpr consent cookies | ||
# if they are only used on the client side | ||
# if they are only used on the client side. | ||
# Example: | ||
# - 'consent_settings' | ||
# => If the cookie "consent_settings" is present, it will be cached. | ||
# But if a "_ga" cookie is present, the request will not be cached. | ||
# Important: Only evaluated if "respect" is empty! | ||
ignore: [] | ||
|
||
# respected cookie params are relevant for the backend and will skip the caching. | ||
# Example: | ||
# - 'Neos_Session' | ||
# => If the "Neos_Session" cookie is present in the request, it will not be cached. | ||
# But if a "_ga" cookie is present, the request will be cached. | ||
# Important: Only evaluated if "ignore" is empty! | ||
respect: [] | ||
|
||
# a request will only qualify for caching if it only contains queryParams that | ||
# are allowed or ignored. All other arguments will prevent caching. | ||
queryParams: | ||
|
@@ -29,8 +42,22 @@ Flowpack: | |
# ignored arguments are not part of the cache identifier but do not | ||
# prevent caching either. Use this for arguments that are meaningless for | ||
# the backend like utm_campaign | ||
# Example: | ||
# - 'utm_campaign' | ||
# => If the "utm_campaign" argument is present in the request, it will be cached. | ||
# But if a "utm_source" argument is present, the request will not be cached. | ||
# Important: Only evaluated if "respect" is empty! | ||
ignore: [] | ||
|
||
# respected arguments are relevant for the backend and will skip the caching. | ||
# All other arguments will be ignored and cached as if they weren't there. | ||
# Example: | ||
# - 'search' | ||
# => If the "search" argument is present in the request, it will not be cached. | ||
# But if a "utm_source" argument is present, the request will be cached as if the argument wouldn't be there. | ||
# Important: Only evaluated if "ignore" is empty! | ||
respect: [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting empty Arrays is a bit nasty, as this will override already set configurations in packages loaded before 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why should another package write this config before this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happens all the time when dependencies between packages are not properly declared. Not actually declaring this key but only documenting it helps in those cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it's not the business of a package to deal with incorrect dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We have a development package for example, we load in require-dev. So i personally prefer to not have empty configurations in configs @Sebobo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @paavo but if that package has a "suggest" or "require" on this package, then then merge order is also fine and you won't have problems. Or is the actual problem using arrays instead of objects? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me make an example @Sebobo with Sitegeist.MagicWand: Then we have a development package we load in require-dev (to only load this on DEV Environments).
Yes, FullpageCache is probably the opposite of a Dev-Package 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then your site package needs also an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am undecided wether we should help here. On the one hand it is an easy fix to not actually write the empty config array. On the other hand projects with basically random loading order between interdepending packages will run into issues eventually that are hard to debug. So we may actually do those a favor ... |
||
|
||
Neos: | ||
Flow: | ||
http: | ||
|
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?