latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

DONOTCACHEPAGE constant is defined. ** Why?

Home Forums Community Forum DONOTCACHEPAGE constant is defined. ** Why?

This topic contains 10 replies, has 3 voices. Last updated by  olly connelly 3 years, 5 months ago.

Topic Author Topic
Posted: Thursday Aug 8th, 2013 at 6:20 am #55410
olly connelly
Username: guv

When s2 is disabled, no caching issues. But, activated, W3TC’s page caching is broken:-

<!-- W3 Total Cache: Page cache debug info:
Engine:             apc
Caching:            disabled
Reject reason:      DONOTCACHEPAGE constant is defined
Status:             not cached
Creation Time:      1.305s
Header info:
Expires:             Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control:       no-cache, must-revalidate, max-age=0
Pragma:              no-cache
Content-Type:        text/html; charset=UTF-8
X-W3TC-Minify:       On
-->

Weird Expires date too but I’m not sure that’s relevant.

What can I do, please, to have s2Member help me to cache what ought to be cached? Can’t find any caching options but do see there’s the no-cache.inc.php file … might that be running riot?

(This is only an issue when logged in, BTW, but the only page I do not want cached is the forum … which is easy enough to configure in W3TC, of course.)

Thank you, as always.

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Thursday Aug 8th, 2013 at 6:59 am #55413

If you cache pages for logged in users (which are likely to be members) then you are going to serve them to non-members that are not logged in, I’m not aware of any option which allows a cache to be created for logged in and a separate cache for logged out members.

So I would advise against it, anyhow there is an option in the ‘general’ section on the ‘page cache’ settings page in W3TC to cache pages for logged in users

Posted: Thursday Aug 8th, 2013 at 7:11 am #55416
olly connelly
Username: guv

Tx Philly.

“If you cache pages for logged in users (which are likely to be members) then you are going to serve them to non-members that are not logged in”

Good point.

“I’m not aware of any option which allows a cache to be created for logged in and a separate cache for logged out members.”

** Now that would be nice! **

I saw this in teh cannily titled no-cache-inc.php, for logged in users:-

if (!defined ("DONOTCACHEPAGE"))
	define ("DONOTCACHEPAGE", true);

But as you say, Philly, maybe this is best left alone.

But, well, how ruddy frustrating. I’d like to be able to offer a fast site to paying members, as well as to guests. Seems only right! Might there be some kind of workaround?

… Some use of fragment caching, f’rinstance? I see that w3TC supports that now.

Any keywords gratefully received, happy to research and post back anything useful.

Posted: Thursday Aug 8th, 2013 at 7:22 am #55418

Do you have full control over your server?

Posted: Thursday Aug 8th, 2013 at 7:40 am #55419
olly connelly
Username: guv

“Do you have full control over your server?”

Yes. Running APC too, BTW.

#hope!

Posted: Thursday Aug 8th, 2013 at 1:22 pm #55428

You could try things like google mod pagespeed if your running apache or varnish, although I’ve found them both to be a hassle with membership sites.

The best gain in speed that I’ve achieved is serving all static content via CDN using two different CNAMES and serving all javascript asynchronously

Posted: Thursday Aug 8th, 2013 at 3:49 pm #55434
olly connelly
Username: guv

Tx again Philly, appreciated.

I am using a CDN for this, albeit suspended until I’m happy with the caching.

Appreciuate your tips, will persevere.

Posted: Thursday Aug 8th, 2013 at 8:26 pm #55455
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

s2Member sets this DONOTCACHEPAGE any time that a Shortcode is used and in all processes that are User-specific or may be dynamic. It’s important that this happens because a Page that’s cached may prevent a User from doing something like edit their profile, or check out via Pro Form.

While caching can speed up your site, you don’t want to cache any Post/Page that has dynamically-generated data in it. That’s why this constant is set.

This is required also for Users that are logged-out because you wouldn’t want to cache Post/Page data that was generated when a User was logged in which is possible.

Posted: Thursday Aug 8th, 2013 at 8:58 pm #55457
olly connelly
Username: guv

cheers Bruce.

I understand that. And wonder (now) why I asked the initial question, at least quite as I worded it.

Seems to me there’s a gaping performance hole here, with this issue. I mean, the vast majority of page content – unless, say, it’s a forum – is static. …

… In my case, the only dynamic component, for logged-in users, on any given page is the “Logout | Profile” div which, when clicked, calls the user’s username, and which will either redirect that user to a successful logout, else take the user to his or her profile page. It seems very silly for that little box, however functionally important, to slow down the entire page.

… So my original question may better have been, “How can I isolate that single div to be dynamic, whilst retaining the rest of the page as static and, therefore, caching? Using fragment caching, perhaps?”

You see my point? And understand my revised question?

For the record, I know that W3TC, that I am using, supports fragment caching now. Might that be the solution, effectively to isolate the single div, as dynamic?

It strikes me that caching is a science all of its own!!! And like any science, it’s a total bugger until properly understood! I appreciate any heads-up on what appears to me to be a most understated yet important topic, (for billions of sites): the art of *fragment caching*.

Thanks guys.

Posted: Thursday Aug 8th, 2013 at 10:34 pm #55459
Bruce
Username: Bruce
Staff Member

… So my original question may better have been, “How can I isolate that single div to be dynamic, whilst retaining the rest of the page as static and, therefore, caching? Using fragment caching, perhaps?”

I’m not familiar with fragment caching myself, but I support this might work, in theory. I’m not totally sure how this works as I’ve never worked with it, but it may cause issues with the way s2Member’s Pro Forms work. I would suggest you ask W3 Total Cache’s team about doing this, maybe they have more information on it.

Posted: Sunday Aug 11th, 2013 at 1:33 am #55538
olly connelly
Username: guv

k, tx Bruce, appreciate that, and note your point about Pro Forms.

Top weekend to you.

Viewing 10 replies - 1 through 10 (of 10 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.