• Resolved cosuqar

    (@cosuqar)


    I am using version 2.1.6

    Sometimes pages are cached after using login form and admin bar starts to appear in non-logged in users. This is not happening consistently but often enough to create problem.

    Don't cache pages for logged in users is checked.
    Don't cache pages for following user roles is checked with all available user roles.

    What could be the issue?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Jesse Owens

    (@jessecowens)

    Hello @cosuqar-

    Thanks for reaching out, that’s definitely odd that the Admin bar is still showing with those settings.

    Do you have any additional layers of caching in your hosting environment, such as an NGINX or Varnish proxy cache?

    When Don't cache pages for logged in users is checked, the pages should be served with no-cache headers, which should be respected by any other caching layer. Can you verify that the following header is present when you view a page while logged-in?
    cache-control: no-cache

    You can check this using your browser’s developer console, in the Network tab.

    If you can recreate the error, can you also check the W3 Total Cache comment near the bottom of your page source to verify that is says “User is logged in?” and double-check the headers on that request as well?

    Thread Starter cosuqar

    (@cosuqar)

    Yes I have that in Request Header

    
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-US,en;q=0.9
    Cache-Control: no-cache
    Connection: keep-alive
    Pragma: no-cache
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92", "Opera";v="78"
    sec-ch-ua-mobile: ?0
    Sec-Fetch-Dest: document
    Sec-Fetch-Mode: navigate
    Sec-Fetch-Site: same-origin
    Sec-Fetch-User: ?1
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/78.0.4093.147
    

    and this is the W3 Total Cache comment in html output

    
    <!--
    Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/
    
    Page Caching using disk 
    
    Served from: neareasthospital.com @ 2021-08-16 23:17:50 by W3 Total Cache
    -->
    

    Thank you @jessecowens

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @cosuqar

    Thank you for the information.
    I’ve checked your website, page by page and I am not seeing the admin bar cached. If you enabled the “Don’t cache pages for logged-in users” option this means that the pages will not be cached for any logged-in user and this means any user roles also, so you can disable “Don’t cache pages for following user roles”. This option should be used if you only want pages not to be cached for specific user roles.
    Is there any specific page this issue occurs on and as @jessecowens asked, are you using any other layer of caching like proxy or server-side caching?
    Thanks!

    Thread Starter cosuqar

    (@cosuqar)

    It is not there consistently. Usually appears after cache was cleared and if there a is logged in user to trigger caching. and no there isn’t any other caching system from server side.

    Thanks @vmarko

    • This reply was modified 2 years, 8 months ago by cosuqar.
    • This reply was modified 2 years, 8 months ago by cosuqar.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @cosuqar

    Thank you for the information.
    1. Make sure that the option “Don’t cache pages for logged-in users” is enabled, save all settings, and purge the cache.
    2. manually delete the wp-content/cache/page_enhanced/ folder. This will ensure that any cached pages are deleted and not being served to the users.
    3. the steps above will ensure that once the page is visited as logged-in it does not get cached.
    Please let me know if this helps, and also make sure to share the URL of the page you are experiencing the issue on.
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Admin bar is showing for non-logged in users’ is closed to new replies.