问题
I have recently added cloudfront to my wordpress site hosted on AWS.
At first my cart would not register any products being added to it - so I made a behaviour in cloudfront to not cache the cart, my account and checkout pages.
Now my users can only add a single product at a time - after adding a second it overwrites what was added in intially.
I believe it must be a problem with the caching behaviour of cloudfront. can anyone help me with what settings I need to get woocommerce to play nice with cloudfront?
here are my settings:
回答1:
i ended up solving this by whitelisting all cookies in cloudfront.
I tried to only whitelist the woocommerce cookies but this didnt work - so not sure which ones I am missing, will keep exploring over the next few days
in the meantime can anyone ansewr if there is a security risk is whitelisting all coookies in cloudfront?
回答2:
The cookie I whitelisted is wp_woocommerce_session_*
. This resolved the same issue I had.
来源:https://stackoverflow.com/questions/46125776/cloudfront-woocommerce-cart-not-updating