Page caching makes websites faster by saving pages and showing the saved copy to the next visitor. With the WithWine plugin, some pages are different for every customer, so they must never be cached. If they are, a customer could see a page meant for someone else, or log in and out unexpectedly.
Set these exceptions up before your website goes live, in your caching plugin, web host or CDN (for example Amazon CloudFront).
Never cache these paths
Don't cache any web address that starts with:
/user/login
/user/logout
/user/checkout
/auth/refresh
/JoinClub
/WithWineOrder
/?rest_route
/wp-json
/LoginCallback
Never serve cached pages to logged-in customers
Don't serve a cached page if the visitor has any of these cookies:
WithWine_AccessToken
WithWine_OidcClient_Jwt
WithWine_RefreshToken
This is essential if you've turned on Allow Authenticated Server Requests in the plugin settings.
Don't block WithWine cookies
The plugin uses cookies starting with WithWine_ for logins and security. Make sure your web server, firewall or CDN doesn't strip them.
Troubleshooting
Customers see someone else's name or cart: a page is being cached. Check the exceptions above, clear your cache and test again while logged in and logged out.
Customers can't stay logged in: check that WithWine_ cookies aren't being removed by your CDN or firewall.
