• Resolved KTS915

    (@kts915)


    I know that regular page caching is not recommended for logged-in users. My host offers Varnish, and it speeds up my sites tremendously. But I have been reluctant to have Varnish deployed on members-only sites in case it causes problems.

    It’s not that the members are each served different content; it’s just that the site needs to be able to identify each one for when they register, login, comment, or use the forum.

    Since this plugin will purge the cache on a comment, does this make it safe to use Varnish on a member-only site? Or will it be problematic for registering and logging-in?

    https://wordpress.org/plugins/varnish-http-purge/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The plugin isn’t doing the caching, it’s doing the purging only. So the real question you have is if VARNISH is okay on a membership site.

    The answer? Maybe. In general, Varnish is set up to not serve cached pages to members, but even so, a member’s actions won’t cause a page to be purged unless they comment (which if you’re using bbPress and BuddyPress includes the forums, as those are all CPTs, which count as ‘a new post’).

    At this time, I, personally, would not use Varnish for a membership site if everyone’s logged in, unless I have root access and can customize the hell out of my rules to provide caching for users. It’ll be great for non-logged in users, but logged in ones won’t get the cache nine times out of ten on the majority of Varnish setups. I know for sure that at DreamHost we don’t cache for the logged in people. WP Engine I believe does it a little differently, but they have their own caching plugin and I would use that, not this one 🙂

    Either way, though, the use of this plugin won’t really impact at all, since it looks for it’s triggers. Logged in or not, if you comment, it will purge 🙂

    Thread Starter KTS915

    (@kts915)

    Thanks for the explanation!

    I realized that this plugin wasn’t doing the caching, but I wondered whether the fact that it would purge on a comment might mean that it would then be safe to run Varnish for logged-in members. (My membership sites involve all users being logged in.) Now I know that it’s not going to make any difference.

    I’m not with DreamHost or WP Engine, but I take it from what you say that Varnish could, in principle, be used for logged-in users. It’s just that it requires customization by someone much more skilled then me!

    I think I’ll talk to my host and see what they can come up with.

    Thanks again!

    Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    *hand waggle* Maybe? The plugin WILL flush the page you’re on when you post a comment, logged in or not. It’s a selective flush, though, so it’s not like it’d flush everything every time (that would suck!).

    To make Varnish work with logged in users, you’d have to make sure the cookies for logged in aren’t used to determine if caching is served or not. Which … is hit or miss in my experience. That’s why we sort of tend to not cache logged in.

    Thread Starter KTS915

    (@kts915)

    Yes, I understand. I wasn’t taking you as saying that it will work, and I wouldn’t be coming back to you and complaining if it caused a problem! (I was just attracted by the selective flush, which would avoid having users look at out-of-date posts, comments, or forum discussions.)

    But your point about cookies is well taken. Cookies are problematic at the best of times!

    Do you have any other suggestions as to how content might be cached for logged-in users? I have read about fragment caching, but that seems currently to be far too advanced for me to implement.

    It’s not that my sites are slow — quite the reverse — but, if I can improve the user experience even more, I would like to do so.

    Thanks very much!

    Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Oh I know 🙂 Just thought if I know something and don’t share, I’m not very nice 😀 Welcome to WP, we’re friendly.

    Fragment caching, which I too am a rookie at, is about right. I personally use memcached to an extent, but I also run a store and I can’t cache that. I was trying to mess with SPDY but it’s not friendly with Apache 2.4 (really what’s up with THAT!?).

    Thread Starter KTS915

    (@kts915)

    Much appreciated!

    In the same spirit, I just got my host to turn Varnish on for one of my membership sites, and it stopped the audio files from playing, so that’s the end of that experiment!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Varnish with logged-in users?’ is closed to new replies.