Skip to content

Commit ff5afb8

Browse files
author
Stephan Backenköhler
committed
skipping cache also if a customer have items in cart for redis-cache, w3tc, wpfc and wpsc
1 parent 4b759da commit ff5afb8

12 files changed

+24
-24
lines changed

ee/cli/templates/redis-hhvm.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/redis-php7.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/redis.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/w3tc-hhvm.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if ($query_string != "") {
1313
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1414
set $cache_uri 'null cache';
1515
}
16-
# Don't use the cache for logged in users or recent commenter
17-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
16+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
17+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|woocommerce_items_in_cart") {
1818
set $cache_uri 'null cache';
1919
}
2020
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/w3tc-php7.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if ($query_string != "") {
1313
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1414
set $cache_uri 'null cache';
1515
}
16-
# Don't use the cache for logged in users or recent commenter
17-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
16+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
17+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|woocommerce_items_in_cart") {
1818
set $cache_uri 'null cache';
1919
}
2020
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/w3tc.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if ($query_string != "") {
1313
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1414
set $cache_uri 'null cache';
1515
}
16-
# Don't use the cache for logged in users or recent commenter
17-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
16+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
17+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|woocommerce_items_in_cart") {
1818
set $cache_uri 'null cache';
1919
}
2020
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/wpfc-hhvm.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/wpfc-php7.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/wpfc.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $skip_cache 1;
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $skip_cache 1;
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

ee/cli/templates/wpsc-hhvm.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if ($query_string != "") {
1212
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
1313
set $cache_uri 'null cache';
1414
}
15-
# Don't use the cache for logged in users or recent commenter
16-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
15+
# Don't use the cache for logged in users or recent commenter or customer with items in cart
16+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|woocommerce_items_in_cart") {
1717
set $cache_uri 'null cache';
1818
}
1919
# Use cached or actual file if they exists, Otherwise pass request to WordPress

0 commit comments

Comments
 (0)