Skip to content
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

v160514-RC: Comet Cache Not Caching Logged-In Users Due to _wpnonce ... #770

Closed
patdumond opened this issue May 16, 2016 · 1 comment
Closed

Comments

@patdumond
Copy link

Trying to test clearing the cache for Logged-In Users when logging out, but Comet Cache is not caching logged-in users on either of my test sites even with the Admin Bar disabled. Both sites are reporting the following:

<!-- Comet Cache is NOT caching this page, because the current page contains `_wpnonce` or `akismet_comment_nonce`. While your current configuration states that pages SHOULD be cache for logged-in visitors, `*nonce*` values in the markup are not cache-compatible. See http://wsharks.com/1O1Kudy for further details. -->

My WebSharks test site has other plugins on it (not Akismet though), but on my personal test site I have disabled all plugins except Comet Cache and s2Member (There's only 1 - Loginizer) and I'm still getting the above message in the HTML Comments even when the Admin Bar is disabled. There's no way to test whether the cache is being cleared if it isn't being cached in the first place.

@raamdev
Copy link
Contributor

raamdev commented May 16, 2016

@patdumond If your site includes a widget that includes a Logout link, the logout link will include a nonce value, which will prevent Comet Cache from caching the page. When you do View Source on your page, simply do a search for "nonce" and you'll find the part of the source code that contains the nonce value; that will tell you which thing on your site is preventing Comet Cache from caching the page.

<a href="http://example.com/wp-login.php?action=logout&#038;_wpnonce=66e11f2371">Log out</a>

Comet Cache simply disables the Admin Toolbar because that's the most common, guaranteed reason that you will see the "NOT caching this page, because the current page contains _wpnonce" message. However, it's certainly not the only reason. Even a Comment Form on a post will generate a nonce value as part of the form markup, and that will prevent Comet Cache from caching the page.


So I'm not seeing anything wrong here. It seems like Comet Cache is doing its job. There's a lot more discussion in #769 where we're considering changing the behavior of Comet Cache with regards to Nonce values for Logged-In users, so you may want to follow that.

@raamdev raamdev closed this as completed May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants