Caching Filters for Plugin Developers
-
Hi there!
I’m one of the developers behind Nelio A/B Testing, a split testing solution for WordPress. We’re interested in improving our compatibility with Breeze Cache and there’s a couple of things that I don’t know how to tackle. I don’t even know if they’re possible and/or they’ll ever be.
1. By default, our plugin loads alternative content by appending an extra query arg in a tested URL via a JavaScript redirection. That is, if a visitor lands on
https://example.com/tested-page/
, our plugin will redirect them tohttps://example.com/tested-page/?nab=X
, whereX
is the variant they’re supposed to see (0 is variant A, 1 is variant B, etc).I looked at Breeze’s settings and I noticed there’s an option named Cache Query Strings. If I add
nab
there, (I think) Breeze behaves as I expected it to — that is, it properly caches each variant.Is there a way to add that
nab
query arg in the list of Cache Query Strings via a filter? This way, users of Nelio A/B Testing and Breeze wouldn’t need to add that extra argument in their URLs — it would work out of the box.2. We’re currently working on a new version of the plugin where, instead of loading alternative content based on the query arg, a user might decide to load alternative content based on the value of a visitor’s cookie. Are there any filters for that? In particular, I’d like to know:
- How do we (plugin developers) specify the name of that cookie?
- What should we do if a visitor requests a page and they don’t have the cookie yet? Is there a way to tell Breeze to skip cache if the cookie doesn’t exist and let WordPress run so that it can (a) generate the cookie and (b) serve the appropriate variant?
Thanks!
- The topic ‘Caching Filters for Plugin Developers’ is closed to new replies.