You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ignore query strings parameter not working for full static caching #11142
Hi, I would like to ignore query strings but allow some for filtering purposes. This is my config but it doesn't seem to work on the latest version of Statamic.
There's only one static file generated for _blog.html.
But there should be a second one with _blog?audience=audience-name.html because pages with the audience query string should be cached too.
I've just noticed you have ignore_query_strings: true - it would need to be false otherwise all query strings are ignored, even the ones you've safe listed.
The allowed_query_strings and disallowed_query_strings config options aren't compatible with full-measure static caching due to the way Apache/Nginx rules work.
They're only compatible with half-measure static caching, as per the original PR (#10701):
Activity
ryanmitchell commentedon Nov 19, 2024
What is your NGINX config?
JoeriE commentedon Nov 19, 2024
@ryanmitchell This is my htaccess config
ryanmitchell commentedon Nov 19, 2024
I've just noticed you have
ignore_query_strings: true- it would need to be false otherwise all query strings are ignored, even the ones you've safe listed.JoeriE commentedon Nov 19, 2024
@ryanmitchell So there's no way to ignore all query string except a few that are listed in the config?
ryanmitchell commentedon Nov 19, 2024
No, you can do that, but you have told it to ignore all query strings.
If you set that to false, then it will only keep the query strings you've specified in
allowed_query_stringsJoeriE commentedon Nov 19, 2024
@ryanmitchell I've changed my config to this:
It keeps caching other query strings:
ryanmitchell commentedon Nov 19, 2024
Yeah you're right - not sure why. I've opened a PR here with the changes needed: #11143
JoeriE commentedon Nov 19, 2024
@ryanmitchell Thanks a lot!!
ryanmitchell commentedon Nov 19, 2024
Going to close it actually, just noticed this comment in the original PR:
#10701 (comment)
duncanmcclean commentedon Nov 19, 2024
The
allowed_query_stringsanddisallowed_query_stringsconfig options aren't compatible with full-measure static caching due to the way Apache/Nginx rules work.They're only compatible with half-measure static caching, as per the original PR (#10701):