-
Notifications
You must be signed in to change notification settings - Fork 100
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
Conflict with Super Cache plugin #188
Comments
Ah, interesting. The PWA plugin does set a cookie when the service worker is installed: And then WP-Super-Cache is doing: } elseif ( $wp_cache_not_logged_in == 1 && ! empty( $_COOKIE ) ) {
wp_cache_debug( 'wpsc_is_caching_user_disabled: true because cookie found' );
return true; The cookie is being used to prevent script concatenation: The intention here is that the service worker will precache the scripts being used in the admin so that they will be served immediately form the browser cache and thus there is no need to concatenate. This intention may be misguided. Nevertheless, what is for sure is that this only applies to the admin. Script concatenation via This will also improve frontend performance a bit by not having this extra cookie being sent in all requests. |
That being said, should WP-Super-Cache really be preventing any page caching when there is any cookie present? That seems like it would cause caching to be disabled very often. |
For example, doesn't the ubiquitous |
Here's a fix: #189. |
Ah, you're right: https://github.com/Automattic/wp-super-cache/issues/620 I'll try to test #189 tomorrow, thanks! |
I haven't had a chance to figure out exactly what's causing this yet, so this may be invalid, but I've noticed that sites with the
pwa
plugin active seem to disable WP Super Cache by making it think that the current visitor is logged in.To reproduce:
/contact/
request, and you'll see<!-- Cached page generated by WP-Super-Cache on 2019-07-04 00:51:12 -->
at the bottom, which is expected. At this point the service worker hasn't been installed yet.<!-- WP Super Cache: Caching disabled for known user. User logged in or cookie found. -->
at the bottom of the response.If you
curl https://2019.europe.wordcamp.org/contact/
you'll always get the correct cached response. If you repeat the steps above with a site that doesn't havepwa
activated -- e.g.,2019.us
-- then you'll also always see the correct cached response.The text was updated successfully, but these errors were encountered: