creativedotdesign / tofino

WordPress boilerplate theme on a modern stack. NPM and Composer.
Other
29 stars 6 forks source link

Cookie notification doesn't play well with cache #251

Closed mrchimp closed 7 years ago

mrchimp commented 7 years ago

If, for example, you use Rocket WP it will cache your homepage with the cookie notification visible. If you then dismiss the notification, it won't clear the cache. A better way would be to display this notification using Javascript. That way it's client side and be cached as much as you like.

I realise this probably isn't a big deal to you, being as you are in a sensible country that doesn't require a cookie notice, but it's causing me a right hassle.

danimalweb commented 7 years ago

Interesting. I use this functionality to display closeable notices to the user in a similar fashion.

Moving the cookie check client side sounds like the way to go.

Which type of caching are you using? WP-Rocket?

mrchimp commented 7 years ago

Yeah, rocket. It's an easy one to miss.

Problem with doing it client side is you have to render out the notification html on every page whether it's needed or not, which is kind of wasteful.

danimalweb commented 7 years ago

Yeah, but probably faster than an Ajax call? I'd go jQuery cookie/show+hide on this one.

mrchimp commented 7 years ago

Cool, I'll look into it.

danimalweb commented 7 years ago

In the next release, there will be a new Theme Option to enable to alerts to be displayed via Javascript instead of PHP. This will solve the caching issue.