diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e7a55..86f480b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - MariaDB 10.5 support (installed by default) - Upgrade to MariaDB 10.5 with `wo stack migrate --mariadb` +#### Changed + +- Improved Nginx caching rules to cache requests with query strings related to analytics (utm_, fbclid) + #### Fixed - Useless php-cli version removal diff --git a/wo/cli/templates/map-wp.mustache b/wo/cli/templates/map-wp.mustache index c1af32c..63b45fa 100644 --- a/wo/cli/templates/map-wp.mustache +++ b/wo/cli/templates/map-wp.mustache @@ -60,11 +60,25 @@ map $http_user_agent $mobile_prefix { } # do not cache requests with query strings -map $is_args $query_no_cache { +map $is_args $is_args_no_cache { default 1; "" 0; } +# cache requests with query string related to analytics +map $args $args_to_cache { + default 0; + "~*utm_" 1; + "~*fbclid" 1; +} + +# do not cache requests with query strings excepted analytics related queries +map $is_args_no_cache$args_to_cache $query_no_cache { + defaut 1; + 00 0; + 11 0; +} + # if all previous check are passed, $skip_cache = 0 map $http_request_no_cache$cookie_no_cache$uri_no_cache$query_no_cache $skip_cache { default 1;