• 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://www.ads-software.com/plugins/w3-total-cache/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Nitac

    (@mchl)

    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

    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.

    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.

    Thread Starter Nitac

    (@mchl)

    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.

    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.

    Thread Starter Nitac

    (@mchl)

    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.

    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

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Logged In User Cache’ is closed to new replies.