Popup Builder and caching challenges
I'm having a really difficult time with Popup Builder. I believe my issues center around caching. Can you confirm that there are issues with this and pretty much any caching plugin? I happen to be using Autoptimize and WP Super Cache. I have setup my popup to be either Only once or Once every X days. I can clear cache and load in one browser. It will always come up. No matter how many times I click the action or X. If I delete the cache and reload, it no longer comes up. What should happen on every refresh. If I load up a different browser free of site cookies, the popup will not load up. It is loading up from the cache of the previous user, which does not load up the HTML involved to make the popup.
Looks like the theme does not render the HTML when the cookie is set. Why not always render it and use Javascript to display/hide it as needed? So if the template is cached to not show for one user, it is cached that way for all users cookie or not. If set to display for all users, cached by first user, it is always shown for all users even after setting the cookie.
Please correct me if I'm wrong here. Otherwise, I'm going to have to recreate all the popups without the theme. I would think most sites are using a caching plugin of some sort and if using popups are getting inconsistent behavior.
See popup-template.php around line 50 and 55 and how it will or won't render the HTML.
Thank you for your time.
Comments
Hello,
What you wrote is correct, it is related to cache, but unfortunately, there is nothing we can do about it.
Caching plugins create their own HTML based on the current website view and later load the website based on this file. So, if it is saved with the popup, it will constantly load this version of your website, and in the same way, if the version without the popup is saved.
You can contact the caching plugin author to ask if there is no workaround for this.
Best regards
Could you not refactor to simply always render the HTML and show or hide based off the cookie using javascript? That is probably what I'm going to do. Set the popup to always show, and write my on JS to hide/show based on existing cookie.
I would think the most people who purchase a theme also use some sort of caching. You are promoting Rocket cache yourselves. I'm surprised that this nice feature becomes inconsistent once caching is involved.
Anyway, I'll post an update of what I do to work around this issue so others can use and build upon.
Thank you.
I have passed your suggestions on to the dev team.
We will take a look at this and see the best solution for that.
Thanks