Skip to content

allowed_query_strings_urls for full measure static caching #1318

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

Open
stuartcusackie opened this issue Mar 10, 2025 · 0 comments
Open

allowed_query_strings_urls for full measure static caching #1318

stuartcusackie opened this issue Mar 10, 2025 · 0 comments

Comments

@stuartcusackie
Copy link

stuartcusackie commented Mar 10, 2025

I just realised that the allowed_disallowed_query_strings options have no effect with full measure static caching. It presents a problem for me as my site needs to ignore gtm_ referal queries but allow collection pagination queries. I don't understand the technicalities of why these options don't work with nginx, but I wonder if there is a workaround.

In reality I'm never going to be using a Google campaign to link to a paginated url, i.e. it makes no sense for my Google ads to link to mywebsite.com/?page=2. So if the these options will never work for full-measure static caching then I wonder if there could be a new option in the static caching config called allowed_query_strings_urls.

`ignore_query_strings' => true,
'allowed_query_strings_urls' => [
  '/blog'
]

This way GTM query strings would be ignored on all pages, except for the '/blog' page, where I need pagination.

Is this possible or am I missing something? Thanks!

Also, it would be nice to have an additional comment in config/static_caching.php to remind us that the current options are incompatible with full measure.

Related ideas / issues:

#1306
statamic/cms#11142 (comment)

@stuartcusackie stuartcusackie changed the title exclude_query_strings_urls for full measure static caching allowed_query_strings_urls for full measure static caching Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant