Codes and details are moved to https://easyengine.io/tutorials/wordpress/woocommerce-window-shopping-caching-technique/
Last active
August 30, 2020 20:40
-
-
Save rahul286/dc64ae84c97868b862c4 to your computer and use it in GitHub Desktop.
woo-commerce fastcgi-cache session-conflict solution (attempt)
@pablopaul both serves different purpose. woocommerce_items_in_cart
is used to decide weather to skip cache or not.
Once a visitor adds something to cart and you decide to skip cache for them, you basically create a different cached version of site for them in lines using wp_woocommerce_session_
set $rt_session "";
if ($http_cookie ~* "wp_woocommerce_session_[^=]*=([^%]+)%7C") {
set $rt_session wp_woocommerce_session_$1;
}
if ($skip_cache = 0 ) {
more_clear_headers "Set-Cookie*";
set $rt_session "";
}
fastcgi_cache_key "$scheme$request_method$host$request_uri$rt_session";
This avoid session/cart collision.
sorry, but where I have to put woo-nginx.conf ? /etc/nginx/
???
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rahul286 why do you prefer to check for the "wp_woocommerce_session_" cookie instead of "woocommerce_items_in_cart"? What benefits do you see?