WordPress.org

Forums

W3 Total Cache
Logged In User Cache (8 posts)

  1. mchl
    Member
    Posted 1 year ago #

    From the searching I've done this seems to be a somewhat common issue for a few people but I haven't managed to find a solution the works for me.

    The majority of users that visit our site are more than likely registered and logged in when browsing so I have enabled the 'Don't cache pages for logged in users' option, but I'm having issue with cached content still being served after a user has logged in and the logged in users cache content being served to new visitors.

    Here's a scenario:

    - User1 visits the homepage not logged in
    - User1 visits page A not logged in
    - User1 logs into site and is redirected to the homepage
    - User1 appears to not logged in on homepage and page A (served cached content)
    - User1 visits page B and can see they are logged in (newly generated cached page)
    - User2 (not logged in) visits page B and is served User1's cached content.

    Ive tried this scenario for admins and subscribers so doesn't appear isolated to a role.

    It seems like the 'Don't cache pages for logged in users' option isn't working. But I'm not sure what other options I can try to rectify the problem, so would be great if anyone had any thoughts.

    Thanks

    https://wordpress.org/plugins/w3-total-cache/

  2. mchl
    Member
    Posted 1 year ago #

    Ive found if User1 visits a page then logs in from another page, and visits the original page (cached content) they are still not logged in.

    But, if I refresh the page i can see the user is logged in.

    Any help would be greatly appreciated.

    Thanks

  3. gbell12
    Member
    Posted 10 months ago #

    Big security concern! Honestly, caching on any site with a member's area seems dangerous. The number of complaints/problems/bugs people post regarding this seems like, even with the "Don't cache pages for logged-in users" feature, you risk serving secure pages to the wrong people.

    And, unfortunately, the developers seem swamped with support requests and aren't able to address this issue.
    Pages are still being cached for logged in users
    Total cache will not let homepage update for logged out users
    Logged-in users can't tell they're logged in

    The best response I can find from Frederick is this one where he says fragment caching is the way to go. It seems easy enough, but I'd only feel confident if I could find good documentation on how this works and why it should be save.

  4. gbell12
    Member
    Posted 10 months ago #

    There is an extensive FAQ I just found.

    Unfortunately, the little bit on fragmented caching doesn't render. If you look at the source code, you'll see why - HTML comments :)

    Here's what it should say:

    How do I implement fragment caching?
    Edit your templates to with the following syntax to ensure that dynamic features remain so:

    Example 1:<!-- mfunc any PHP code --><!-- /mfunc -->
    Example 2:<!-- mfunc -->any PHP code<!-- /mfunc -->
    Example 3:<!--MFUNC --> echo rand();<!--/mfunc -->
    Example 4:<!-- mclude path/to/file.php --><!-- /mclude -->
    Example 5:<!-- mclude -->path/to/file.php<!-- /mclude -->

    Not sure that really clears anything up :) Inconsistent capitalization and spacing is a worry. The call to rand() is an interesting idea - it is a way of uniquely identifying a page render so that you can tell if you're seeing a cached copy or not.

  5. mchl
    Member
    Posted 10 months ago #

    I've actually moved on and have started using another caching plugin which handles user caching amongst other things in a simpler way than W3TC.

    I'm sure someone else will find this info useful though.

    Cheers for the response.

  6. gbell12
    Member
    Posted 10 months ago #

    Hi mchl - please share which plugin you found.

    Here's a response from W3TC:

    Are you a W3 Total Cache Pro customer? Pro unlocks fragment caching in W3TC, which is needed to accomplish what you're doing. Initial documentation is limited, but what's there is enough to get you started if you know your way around WordPress theme development. Fragment caching in W3TC is just utilizing the WordPress Transients API, we're not doing anything proprietary.

  7. mchl
    Member
    Posted 10 months ago #

    Ive ended using Quick Cache Pro (Everything I needed with very simple and minimal set up) after trialling a few different plugins, on top of the user cache issue i was having i found the WT3C slowed down the admin too much aswell. I was also deterred by their support as the pricing structure was too vague.

  8. garciasanchezdani
    Member
    Posted 10 months ago #

    Hi @mchl , I just installed w3 total cache plugin, because my website loads very very slow. This plugin increases the load of the site, but now I'm having just your same problem.
    The caching is bad in the way of logged and not logged users.....what did you do at the end? what plugin are you using?

    I imagine that in paid version of w3 total cache, this issue isn't happening and it's fixed...

    Regards, Daniel

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic