Skip to content

Commit 8de1d24

Browse files
author
Maxime Jobin
committed
Cookie added for WP Touch. Specific mobile cache detection.
1 parent 0ae8cfe commit 8de1d24

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

rocket-nginx.conf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ if ($rocket_hsts = "0") {
6060
# index-mobile.html
6161
# index-mobile-https.html
6262
set $rocket_url "/wp-content/cache/wp-rocket/$http_host/$request_uri/index$rocket_https_prefix.html$rocket_encryption";
63-
set $rocket_mobile_url "/wp-content/cache/wp-rocket/$http_host/$request_uri/index-mobile$rocket_https_prefix.html$rocket_encryption";
64-
6563
set $rocket_file "$document_root$rocket_url";
66-
set $rocket_mobile_file "$document_root$rocket_mobile_url";
64+
set $rocket_mobile_detection "/wp-content/cache/wp-rocket/$http_host/$request_uri/.mobile-active";
6765

6866

6967
# Do not bypass if it's a POST request
@@ -87,14 +85,14 @@ if (-f "$document_root/.maintenance") {
8785
# Do not bypass if one of those cookie if found
8886
# wordpress_logged_in_[hash] : When a user is logged in, this cookie is created (we'd rather let WP-Rocket handle that)
8987
# wp-postpass_[hash] : When a protected post requires a password, this cookie is created.
90-
if ($http_cookie ~* "(wordpress_logged_in_|wp\-postpass_|woocommerce_items_in_cart|woocommerce_cart_hash)") {
88+
if ($http_cookie ~* "(wordpress_logged_in_|wp\-postpass_|woocommerce_items_in_cart|woocommerce_cart_hash|wptouch_switch_toogle|comment_author_|comment_author_email_)") {
9189
set $rocket_bypass 0;
9290
set $rocket_reason "Cookie";
9391
}
9492

95-
if (-f "$rocket_mobile_file") {
93+
if (-f "$rocket_mobile_detection") {
9694
set $rocket_bypass 0;
97-
set $rocket_reason "Mobile/Desktop cache activated";
95+
set $rocket_reason "Specific mobile cache activated";
9896
}
9997

10098
# Do not bypass if the cached file does not exist

0 commit comments

Comments
 (0)