Closed vaska94 closed 4 years ago
/^(wp-postpass|wordpress_logged_in|comment_author|woocommerce_items_in_cart|wp_woocommerce_session)_?/
@svenba, Hi
Example cookie set by woocommerce is : wp_woocommerce_session_c1f2e998c64113d5c9eb8bce724113b9
woocommerce appends random hash to wp_woocommerce_session_
. so you'r example is incorrect.
^(wp-postpass|wordpress_logged_in|comment_author|woocommerce_items_in_cart|wp_woocommerce_session_.*)
is correct.
Hi @vaska94,
The regular expression you’ve provided only covers a hash applied to wp_woocommerce_session_[hash]
:
A hash is also applied to the following cookies:
wp-postpass_[hash]
wordpress_logged_in_[hash]
comment_author_[hash]
wp_woocommerce_session_[hash]
woocommerce_items_in_cart
doesn’t have a hash applied. WordPress and WooCommerce cookies information can be found in the following resources:
Our current approach matches the cookie name without the hash. Providing an exact match for the hash isn’t necessary because the preg_match()
function in the cache_enabler.class.php
file (L1351-L1363) will return true after the first match is found:
Feel free to submit a new pull request with the changes made.
Hi, as you know Facebook adds "fbclid" get parameter to all urls that cause cache to be bypassed, I thought it would be good idea to ignore "fbclid" parameter by default. also i have modified cache exclusion example which was incorrect!