Hi all,
Using Redis Cache on a multisite, I see there is a rule in common/redis-php7.php that is has something for Woocommerce in particular:
# Don't use the cache for logged in users or recent commenter or customer with items in cart
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") {
set $skip_cache 1;
}
Since I’m not using Woocommerce but Easy Digital Downloads on this installation, I can easily adapt this rule to listen for the edd cookie edd_items_in_cart
but it says at the top of the file:
# Redis NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee)
set $skip_cache 0;
This makes things difficult. Firstly because I don’t want to keep re-modifying files after updates, and secondly because the $skip_cache is set to zero right at the beginning. This means I cannot add my rule to the main site conf file. The $skip_cache will be reset to 0 whatever I do
Nor would my rule do any good in the site specific conf dir as these are loaded last.
So how to do this then?
Would it not be nicer to make that cookie signature just a little bit more inclusive with [a-f0-9]+_items_in_cart
so that it recognizes at least TWO (and maybe more?) shopping cart plugins instead of just one?