fdmind/ignore-query-strings

If your website has static caching on, and you drive traffic to it from social media, Google Ads and other sources that add query string parameters to the URL, there is a chance that each time new user visits a page, it will not be served from cache, but will be generated from scratch. This is because the URL with query string parameters is treated as a different URL from the one without query string parameters.
5,698 5
Install
composer require fdmind/ignore-query-strings
Latest Version:v3.0.0
PHP:^8.0
Laravel:12 · 13
License:MIT
Last Updated:Mar 12, 2025
Links: GitHub  ·  Packagist
Maintainer: krzemo

Ignore Query String Parameters

If your website has static caching on, and you drive traffic to it from social media, Google Ads and other sources that add query string parameters to the URL, there is a chance that each time new user visits a page, it will not be served from cache, but will be generated from scratch. This is because the URL with query string parameters is treated as a different URL from the one without query string parameters.

You could always set 'ignore_query_strings' => true, but that would mean that you would not be able to use query string parameters in your templates.

This addon allows to have both: ignore query string parameters for caching purposes, but still be able to use them in your templates.

DISCLAIMER: Addon will not work if you have full static caching on and Nginx rules set up to serve static html files directly.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require fdmind/ignore-query-strings

How to Use

Addon comes with ignore-query-strings.php config file, where you can specify which query string parameters Statamic should allow or deny. By default, it is set to allow only most popular parameters, but you can remove and add your own.

Related Packages

visuellverstehen/statamic-advanced-invalidator

A Statamic invalidation class for static caching with advanced capabilities.

1,177 0
marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

155,749 23
mattbromley/inertia-statamic

A fork of the Inertia.js Statamic adapter by Adam Campbell

2,242 4

Version History

Version Released PHP License
v3.0.0 ^8.0 MIT
v2.0.1 ^8.0 MIT
v2.0 ^8.0 MIT
v1.0.2 ^8.0 MIT
v1.0.1 ^8.0 MIT