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

Add support for Comet Cache Pro logged-in user caching #888

Closed
raamdev opened this Issue Feb 23, 2016 · 13 comments

Comments

Projects
None yet
3 participants
@raamdev
Contributor

raamdev commented Feb 23, 2016

s2Member currently supports ZenCache logged-in user caching, however now that ZenCache has been renamed to Comet Cache we need to update the s2Member codebase to work properly with the new plugin.

Forked from websharks/comet-cache#676.

@raamdev raamdev added the compat. label Feb 23, 2016

@raamdev raamdev added this to the Next Release milestone Feb 23, 2016

jaswrks pushed a commit that referenced this issue Feb 23, 2016

@jaswrks jaswrks referenced this issue Feb 23, 2016

Merged

PR: feature/888 #889

jaswrks pushed a commit that referenced this issue Feb 23, 2016

@jaswrks jaswrks self-assigned this Feb 23, 2016

@jaswrks

This comment has been minimized.

Member

jaswrks commented Feb 23, 2016

Next Release Changelog:

  • (s2Member/s2Member Pro) Comet Cache Compat.: This release improves compatibility with Comet Cache (formerly ZenCache), whenever you have it configured to cache logged-in users. See also: this GitHub issue. Props @KTS915 for reporting!

@jaswrks jaswrks closed this Feb 23, 2016

@KTS915

This comment has been minimized.

KTS915 commented Feb 23, 2016

Wow! That was quick!

@raamdev

This comment has been minimized.

Contributor

raamdev commented Feb 25, 2016

@jaswsinc In websharks/comet-cache#676 (comment) you write...

We have some additional code in the s2Member plugin itself that accomplishes full compatibility between the two.

Can you elaborate on what "full compatibility" means? I was just testing the v160225-RC that includes your work to improve compatibility with Comet Cache, however it's clear to me that some pages are not going to be cached by Comet Cache due to the fact that the page contains a Pro-Form or other dynamic s2Member content.

The article on the s2Member site that @KTS915 linked to in the other GitHub issue doesn't seem to be very clear on what compatibility means either:

it works in complete and total harmony with all s2Member features—without any additional configuration needed whatsoever.

Tip: Comet Cache has a unique ability to cache logged-in users too, which is highly effective whenever it runs alongside the s2Member Pro application; keeping WordPress fast even when a user is logged in as a member. Very impressive!

https://s2member.com/kb-article/is-s2member-compatible-with-caching-plugins/


Would you mind clarifying what we can expect from from s2Member's compatibility with Comet Cache? The fact that this isn't clear to me is making testing this fix in the RC rather difficult (I'm not entirely sure what should and what should not be working).

@jaswrks

This comment has been minimized.

Member

jaswrks commented Feb 25, 2016

s2Member will prevent caching on user-specific and/or dynamic content (e.g., Posts/Pages that contain an s2Member shortcode or conditional tag, the MOP and LWP, etc) whenever a user is logged in. This is an additional precaution on the part of s2Member to ensure that dynamic content it generates is never cached for any specific user and then displayed to another from the cache.

However, whenever Comet Cache (and ZenCache in the past) are running with user-specific caching enabled, s2Member can allow this to occur, because our plugins do in fact allow for user-specific content to be cached in an intelligent way. For this reason, there must be conditionals in s2Member that will look for the presence of these user-cache-compatible plugins like Comet Cache and ZenCache. If they are running and configured to allow for a user-specific cache, we allow those pages to be cached as one would expect them to be.

@raamdev

This comment has been minimized.

Contributor

raamdev commented Feb 25, 2016

For this reason, there must be conditionals in s2Member that will look for the presence of these user-cache-compatible plugins like Comet Cache and ZenCache. If they are running and configured to allow for a user-specific cache, we allow those pages to be cached as one would expect them to be.

So the s2Member Login Welcome Page should get cached by Comet Cache when Logged-In User caching is enabled? If so, that does not appear to be happening with Comet Cache Pro v160223.1 + s2Member Pro v160225-RC:

<!-- Comet Cache is NOT caching this page, because the s2Member plugin set the PHP constant `COMET_CACHE_ALLOWED` to a boolean-ish `FALSE` value at runtime. The s2Member plugin is serving content that must remain dynamic on this particular page, and therefore this page was intentionally not cached for a very good reason. -->
@jaswrks

This comment has been minimized.

Member

jaswrks commented Mar 2, 2016

@raamdev I was unable to reproduce this. Did you have the [s2Member-Profile /] shortcode on the page or any other shortcode perhaps?

@jaswrks

This comment has been minimized.

Member

jaswrks commented Mar 2, 2016

I see. I was able to reproduce this when there are shortcodes present. I need to have another look at why we chose to do that even when logged-in caching is enabled.

@KTS915

This comment has been minimized.

KTS915 commented Mar 2, 2016

Ah, that explains why it also happens to me. I have a widget containing a shortcode on the LWP. No shortcodes are in the page itself.

@jaswrks

This comment has been minimized.

Member

jaswrks commented Mar 2, 2016

OK. So sorry. The explanation that I gave for this before was not entirely accurate. Let me try this once more now I've reviewed the codebase again.


There are a few subtle alterations in s2Member when it comes to the LWP and MOP. However, the real issue between s2Member and Comet Cache (i.e., the reason for considerations to be made in both plugins), is because s2Member will prevent the caching of logged-in users. Period.

In other words, s2Member has built-in routines that will prevent any caching plugin from caching pages for logged-in users. This was in an effort to avoid caching plugin conflicts. Generally speaking, that's still a good idea in my view.

However, when s2Member can detect that Comet Cache or ZenCache are running, it allows those particular plugins to cache pages for logged-in users according to their configuration; i.e., it won't stand in their way. So that's the issue that was resolved here.


As for the MOP and LWP. Those pages can be cached for logged-in users like any other, now that s2Member has been updated for compatibility with Comet Cache. However, if you introduce some of s2Member's more dynamic shortcodes on a page, those will still prevent caching, no exceptions.

So for instance, if you add the [s2Member-Profile /] shortcode to a page it cannot be cached, even if you tell Comet Cache to allow caching of logged-in users. That's s2Member flagging dynamic content that it considers uncacheable.

@KTS915

This comment has been minimized.

KTS915 commented Mar 2, 2016

No need for apologies!

This doesn't quite explain my experience, though. I'm not using an s2Member shortcode, but the one from Basic Users Avatars. See https://wordpress.org/plugins/basic-user-avatars/

I have it in a text widget.

@jaswrks

This comment has been minimized.

Member

jaswrks commented Mar 3, 2016

@KTS915 That should be fixed soon. The comments in my last reply regarding compatibility with Comet Cache haven't actually been pushed out yet. They are coming soon though. As in, tomorrow, most likely.

@KTS915

This comment has been minimized.

KTS915 commented Mar 3, 2016

Great! Thanks!

@jaswrks

This comment has been minimized.

Member

jaswrks commented Apr 23, 2016

s2Member & s2Member Pro v160423 have been released and they include changes from this GitHub Issue. See the v160423 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one. Thanks! :-)

@websharks websharks locked and limited conversation to collaborators Apr 23, 2016

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