This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I did my personal version. I use Beda's JS code to set the cookie and then I've built a custom shortcode to check if the cookie is set. It works fine.
My problem is that WP Fastest Cache is caching the page before I click the consent button (that stores the cookie). When the page is reloaded on consent click, the cookie is corretly stored, but the browser loads the cached version of the page and it still displays the consent form instead of the map.
If I open other pages with maps, they are correctly displayed, because the cheking cookie shortcode works fine. But if I go back to the first page where I clicked the consent button, I still get the button instead of the map.
Is there a way to load all the Map code on the page (so it would be cached), but not activate it (so it doesn't store any cookie and it doesn't display the map) untill I click the consent button?
Hello. Thank you for contacting the Toolset support.
The solution provided by Beda was using the custom code and thats not the official Toolset feature. Also we do not have extensive exposer about how " WP Fastest Cache " plugin cache works. The question you raise here you should actually ask to " WP Fastest Cache " plugin support and I believe they will guide you better in this matter.
My problem is that WP Fastest Cache is caching the page before I click the consent button (that stores the cookie). When the page is reloaded on consent click, the cookie is corretly stored, but the browser loads the cached version of the page and it still displays the consent form instead of the map.
If I open other pages with maps, they are correctly displayed, because the cheking cookie shortcode works fine. But if I go back to the first page where I clicked the consent button, I still get the button instead of the map.
==>
As the plugin WP Fastest Cache is caching the page before you click the consent button would you mind to check with the "WP Fastest Cache" plugin support and check with then if they offer any hook or filter that you can use to solve your problem.
Hi Minesh, thanks for your answer. I'm going to contact Fasters Cache support, but what I read in their documentation is that it is possible to exclude elements by URL, so I could only exclude pages with maps from caching. This is 80% of my pages, so it is like I deactivate caching.
I found that I could exclude a JS script from caching in this way: