Improved query strings caching

This commit is contained in:
VirtuBox
2020-10-25 14:19:08 +01:00
parent 665453dcbc
commit 3d32e02c65
2 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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;