sforcash
sforcash

Reputation: 429

Wordpress Payment Plugin Site-Wide Cookie Preventing Varnish Edge Caching Through Pantheon

Running in circles trying to leverage Pantheon's CDN/Varnish edge caching.

Have a Wordpress site uses the WP Simple Pay Lite plugin to process Stripe transactions on one page. That plugin creates a session cookie to allow correct handling of payment success/failure.

That session cookie prevents caching via Varnish. As I understand it, a lot of people run into this with WooCommerce as well, but I'm having a hard time finding a clear solution and Pantheon support is giving me the "this is beyond our support", which is fair, but it seems this would be a very common issue.

Simple Pay's docs specifically mention Pantheon as an exception and refer to using Pantheon's Native Session plugin (which we are), which as I understand it, offloads sessions to the database. The next step isn't really clear to me though as that alone doesn't eliminate the session, only switches how it's handled.

So does anyone have a solid workaround for this site-wide cookie whether through Simple Pay Lite, WooCommerce or otherwise?

If I can't get a better solution working, I suppose I could just move the payment piece to a subdomain, but would love a cleaner solution.

I've done a little looking at selectively loading the plugin only for the one page that uses they payment form, but a lot of the solutions there are pretty generic and I'm not sure my level of expertise is going to get me over the hump.

Bear with me... kind of flailing here.

Upvotes: 0

Views: 77

Answers (1)

deronimo
deronimo

Reputation: 519

Yeah, Pantheon can be extremely annoying. Try prepending "STYXKEY_" to the name of all cookies (e.g. "STYXKEY_my-cookie") that you set and get. Checkout this Pantheon page regarding caching (https://docs.pantheon.io/caching-advanced-topics). The prepended string tells Pantheon to include the cookie.

Goog luck.

Upvotes: 0

Related Questions