• Resolved hagenb

    (@hagenb)


    Apologies for the long post, but I have to explain everything to get the issue I’m experiencing across.

    Side note – I opened a ticket on litespeedtech but was told to post here. https://www.litespeedtech.com/support/forum/threads/issue-with-cache-on-home-page-for-logged-in-users.21347/

    I’m using “User Menus – Nav Menu Visibility” plugin to display “Login” for users that are logged in and “Logout” and “My Account” for users that are not logged in.

    The problem is that after the user logs in, they are redirected to the “Home” page, if they look in the menu “Logout” will appear (as it should), but if they go to another page and return to the main page, the menu shows “Login” again. They have to manually refresh the page for it to be fixed.

    Disabling cache in the plugin or from CPanel does not fix the issue, but adding the following in my .htaccess does:

    # Begin LSCACHE

    Header set Cache-Control “no-cache, no-store, must-revalidate”

    Header set Pragma “no-cache” Header set Expires 0

    # End LSCACHE

    I have seen this issue being reported on other Cache plugins as well, like this one has exactly the same issue I have – https://ww.wp.xz.cn/support/topic/cache-page-is-being-displayed-to-logged-in-users/

    Any help would be greatly apprieciated.

    Thank you.

Viewing 15 replies - 1 through 15 (of 111 total)
  • Header set Cache-Control “no-cache, no-store, must-revalidate”

    This is for browser caching and has nothing to do with cache plugin or is cause for your issue, so remove it.

    Header set Pragma “no-cache” Header set Expires 0

    This only tells external proxies not to cache the request, but also doesn’t have something to do with your issue.

    Do you use any plugin for login or any other custom modification for login procedure? Do you use a CDN or any other cache plugin?

    Thread Starter hagenb

    (@hagenb)

    Thank you for your reply.

    Do you use any plugin for login or any other custom modification for login procedure?

    Yes, I use “Login/Signup Form” for handling login and registration (https://ww.wp.xz.cn/plugins/easy-login-woocommerce/). But I have tried several other login/register plugins and they all behave the same.

    Do you use a CDN or any other cache plugin?

    I deleted all the cache plugins I had and tested with the same result.

    • This reply was modified 3 years, 5 months ago by hagenb.
    • This reply was modified 3 years, 5 months ago by hagenb.

    The LiteSpeed LScache plugin was developed for standard WP functions. Since every plugin works somehow differently, it is simply impossible to take into account every conceivable variation through a 3rd plugin. But that doesn’t mean there isn’t a solution. There is, however, a plugin cannot do this as it is designed to be used under standard conditions. Ask the plugin support @qtwrk if he can develop a custom solution for you.

    Thread Starter hagenb

    (@hagenb)

    Is there any login/register WordPress plugin, that you know of, that works with the Litespeed LScache plugin for me to test if I get the same issue?

    I’m sorry, no, but the solution to the problem is not a large plugin, so the effort for it is limited. Just ask @qtwrk. Maybe he’ll come up with a simple solution right off the bat.

    Thread Starter hagenb

    (@hagenb)

    @qtwrk

    Do you have any recommendations for me to try fixing this? I’ve seen a lot of topics on this, but none of them have any solutions.

    • This reply was modified 3 years, 5 months ago by hagenb.
    Thread Starter hagenb

    (@hagenb)

    @serpentdriver @qtwrk

    I would just like to add that I’ve noticed that this only happens on the page right before going to the “Login” page.

    For example: About -> Login -> Home (redirected from Login)

    With the example above, the issue will be on the “About” page. This is true for any page that I’m on before going to the “Login” page.

    Also, If I set “/” inside “Do Not Cache URIs” then the problem is completely gone.

    Thread Starter hagenb

    (@hagenb)

    LATEST UPDATE:

    After testing some more – It happens on ALL the pages I visit before logging in. If I haven’t visited a page before I logged in, the issue is not there (The menu has been updated).

    So the problem is that logged-in Users get cached pages (Pages they visited before logging in).

    To fix this I have to refresh each page I visited before logging in.

    I have tried enabling and disabling “Cache Logged-in Users” with no luck.

    Thread Starter hagenb

    (@hagenb)

    @serpentdriver

    I can’t find a sulotion for this, I ended up adding the following in my .htacces:

    https://yourimageshare.com/ib/9EdkPfVbnl

    The problem seems to be with browser cache. Well, that the only thing that fixes the problem I’m having.

    In your first answer you said that this has nothing to do with my issue, but why is it the only way (that someone can give me) that works?

    • This reply was modified 3 years, 5 months ago by hagenb.
    • This reply was modified 3 years, 5 months ago by hagenb.
    • This reply was modified 3 years, 5 months ago by hagenb.
    • This reply was modified 3 years, 5 months ago by hagenb.
    Plugin Support qtwrk

    (@qtwrk)

    by default , wordpress itself will instruct cache-control: no-cache, must-revalidate,max-age=0 header to tell browser not to cache the page but always fetch from server again

    if you have touched/altered this part, it could cause issue like this

    Thread Starter hagenb

    (@hagenb)

    @qtwrk

    Thank you for your reply.

    If you have touched/altered this part, it could cause issue like this

    I added this after this issue was already present.

    by default , wordpress itself will instruct cache-control: no-cache, must-revalidate,max-age=0 header to tell browser not to cache the page but always fetch from server again

    WordPress did not do this by default, that is when I started searching how to prevent browser cache after a user has logged in and that is when I added the above. After removing the above, this issue comes back.

    I honestly do not know what to do, or where to even start fixing this.

    Any guidance would be greatly appreciated.

    Plugin Support qtwrk

    (@qtwrk)

    WP does give cache-control: no-cache, must-revalidate, max-age=0 on default set up , I just tested that

    and you should keep it that way , to prevent browser to cache the page.

    Thread Starter hagenb

    (@hagenb)

    Ok I have removed it. But I still have the following issue:

    After testing some more – It happens on ALL the pages I visit before logging in. If I haven’t visited a page before I logged in, the issue is not there (The menu has been updated).

    To fix this I have to refresh each page I visited before logging in.

    Do you perhaps know what I can do to fix this?

    Plugin Support qtwrk

    (@qtwrk)

    what did you remove ? also please check what is the HTTP response header on the page where you got the issue

    Thread Starter hagenb

    (@hagenb)

    @qtwrk

    If you would like to test it, here is the website I’m having the issue with : http://www.wondertree.co.za

    I have created a login user for testing purposes, you can use the following to login – Username : HBi Password: 1234567

Viewing 15 replies - 1 through 15 (of 111 total)

The topic ‘Litespeed causing issue with menu’ is closed to new replies.