• Resolved vividkind

    (@vividkind)


    Any pages accessed & cached before logging in show the wrong nav menu & ignore cache rules.

    PMPro for membership access – This is determining which menu should be shown.
    Elementor Pro page builder
    Elementor Hello theme

    I have 2 nav menus: Logged-In and Logged-Out.
    If a user accesses any of the public pages before logging in and navigate back to those pages after logged in, they will see the Logged-Out nav menu. This can be fixed by refreshing the page, but it is not a permanent solution.

    The correct menu shows on any page(s) that were not accessed pre-login.

    Seems to be some sort of Browser Cache issue.

    Page Cache Enabled. Page Cache Method Disk: Enhanced.
    Minify is disabled.
    Disable cache for logged-in users is enabled.
    Have tested with Browser Cache enabled & disabled with the following disabled for all categories they exist:

    • Set Last-Modified header
    • Set expires header
    • Set cache control header

    Hosting server cache is disabled according to the host.

    Logged-in menu shows “Help Desk” on the top right.
    Logged-out menu shows “Contact”

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vividkind

    Thank you for reaching out and I am happy to help!

    This really depends on the plugin you are using for this. Can you please confirm that the issue continues to persist if you disable cache control and expire the header for HTML&XML in Performance>Browser Cache?
    I have found the documentation of the plugin you are using for this, and they have specific instructions for the W3 Total Cache.

    You can also exclude the front page from being cached if disabling Browser Cache settings does not work, or you can try the Page Fragment Cache, and exclude specific parts of the page from being cached by wrapping the code with <mfunc>

    Let me know if this helps!

    Thanks!

    Thread Starter vividkind

    (@vividkind)

    I followed PMPro’s instructions on setting up caching & have verified it with their support.

    I set the following settings for Browser Cache on CSS & JS, HTML & XML, and Media and was able to stop the menu caching issue on all pages except for the home page:

    • Set-Last-Modified Header Enabled
    • Set Expires Header Disabled
    • Set Cache Control header Enabled
    • Cache Control Policy – don’t cache

    I have the setting to disable caching of the homepage, but it still occurs, and this is verified on https://www.giftofspeed.com/cache-checker/

    http and https website url shows cache-control with an expiration of 2hrs

    Under Page Cache, I have enabled Don’t Cache Front Page.

    I also added the website’s home URL (HTTP and HTTPS) to Never Cache The Following Pages.

    Another note, as a recommendation of Really Simple SSL to prevent issues, I have set the Page Cache Method to Disk: Basic.

    Unfortunately, testing any other cache policies resulted in the menu issue coming back. Also, when entirely disabling W3TC, it appears that by having no caching policies, browser cache defaults to cache everything again. My host (BlueHost) confirmed there are no caching policies for the server, and server caching is disabled. I am not currently using a CDN, but had planned to use one once caching works properly.

    Thread Starter vividkind

    (@vividkind)

    Also, Minify, Object Cache, and Database Cache are disabled.

    Hello @vmarko,

    I have similar problem here and I wrapped my nav element that is shown alternatively to logged-in and logged-out users in html tag <mfunc> but it didn’t solve the issue. Is there a way to exlude this mfunc element from caching in any other way?

    Kind regards,

    Barnabas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Incorrect Nav Menu Cached Shown for Logged In Users’ is closed to new replies.