New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching plugins like WP Fastest cache causing issues #30

Closed
fclaussen opened this Issue Apr 11, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@fclaussen
Member

fclaussen commented Apr 11, 2018

Sites that have caching enabled causes preference updates to be ignored until cache is purged.

@harper-smith

This comment has been minimized.

harper-smith commented Apr 17, 2018

I have a similar issue with WP Super Cache plugin. Maybe the "I Agree" button can clear the cache and reload the page?

@fclaussen

This comment has been minimized.

Member

fclaussen commented Apr 18, 2018

From what I could see from WP Super Cache, there's no way around it.

https://wordpress.org/plugins/wp-super-cache/#faq

Looks like this caching kills any type of dynamic solution that is not javascript based.
That's why the privacy bar is still showing, or the reconsent takeover is still showing even after agreeing to the terms.

I still don't know what our options here are. I can't purge the cache like this.

@harper-smith

This comment has been minimized.

harper-smith commented Apr 19, 2018

for now I have turned off WP Super Cache, it makes some performance increase but I prefer to be compliant with the law first and foremost.

Im not a coder so excuse my ignorance but does the GDPR plugin work dynamically if so then there is a faq for "How do I make certain parts of the page stay dynamic?" on the WP super cache page.

@fclaussen

This comment has been minimized.

Member

fclaussen commented Apr 20, 2018

For it to stay dynamic, verifications like "Should I include the privacy bar?" should be done via javascript and not PHP like it is right now.

Caching takes the page markup at one moment and saves that state. If that state contains the bar, it will show it even if it is not needed.

If we do it with javascript, the javascript will figure this out dynamically and we will achieve the desired behavior.

That's what I'm thinking and what I've read. I still need to make this change and test it out.

I'll be pushing a solution for cache plugins soon, maybe next week, but I can't promise.

@Creanimo

This comment has been minimized.

Creanimo commented Apr 29, 2018

Sounds very promising!
Will it work with the if functions I already added to my functions.php?

Thanks for your excellent work!

@fclaussen

This comment has been minimized.

Member

fclaussen commented Apr 30, 2018

If you are running a caching plugin, it will serve a static version of your page at the moment it was saved to cache. That means it will not run your PHP if statements. You should switch to javascript.

@oxyc

This comment has been minimized.

oxyc commented Apr 30, 2018

FYI with WP Super Cache if needed you can create separate caches for separate consents

<?php

/**
 * Create separate cache files based on the cookie consent value.
 */
add_filter('supercache_filename_str', function ($string) {
    $cookie = $_COOKIE['gdpr']['consent_types'] ?? null;
    if ($cookie) {
        $string = $string . '-' . $cookie;
    }
    return $string;
});

Unfortunately this needs to be added to the plugins own plugins/ subfolder plugins/wp-super-cache/plugins/gdpr.php.

@Creanimo

This comment has been minimized.

Creanimo commented Apr 30, 2018

Oooh interesting. Thanks for the tip! I will look into this!

@fclaussen fclaussen closed this Jun 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment