• 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 - 61 through 75 (of 111 total)
  • Thread Starter hagenb

    (@hagenb)

    Ok, I have changed it back for you to test.

    Now I know what is wrong at your site! Do you have any plugin installed that has anything to do with caching?

    • This reply was modified 3 years, 4 months ago by serpentdriver.

    Do you understand what that means?

    Thread Starter hagenb

    (@hagenb)

    I have tried a few plugins like WP Optimise, but they are all uninstalled now. The only one I have currently is LiteSpeed..

    Thread Starter hagenb

    (@hagenb)

    Do you understand what that means?

    It means that the cache is set to that period?

    Your server configuration is wrong, but this hasn’t something to do with the cache plugin. Either you have any plugin installed that changes browser cache settings or|and you have such setting in your .htaccess!!!!

    It means that the cache is set to that period?

    That means that the main document is cached in browser cache, but max-age MUST BE 0! And it may not be public, it must be private! This is the reason for the issue!

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

    (@hagenb)

    I have found the following in my .htaccess, don’t know what it is or how it got there….

    ### marker FAVICON start ###

    RewriteRule favicon\.ico$ – [E=cache-control:max-age=86400]

    ### marker FAVICON end ###

    EDIT: It seems to be part of the theme I’m using – Astra

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

    No, this is related to the favicon.ico and is okay.

    Could you please post your .htaccess?

    EDIT: It seems to be part of the theme I’m using – Astra

    No it’s, from cache plugin.

    Thread Starter hagenb

    (@hagenb)

    I have 2.. I have a htaccess and a .htaccess.bk. Here is the .htaccess:

    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} ^\/$  [NC]
    
    RewriteRule ^.*$ - [ENV=CACHECONTROL:true]
    
    Header set Cache-Control "max-age=0,private,no-cache,no-store,must-revalidate" env=CACHECONTROL
    
    # BEGIN LSCACHE
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    <IfModule LiteSpeed>
    
    RewriteEngine on
    
    CacheLookup on
    
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    
    RewriteRule \.litespeed_conf\.dat - [F,L]
    
    ### marker CACHE RESOURCE start ###
    
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    
    ### marker FAVICON end ###
    
    ### marker DROPQS start ###
    
    CacheKeyModify -qs:fbclid
    
    CacheKeyModify -qs:gclid
    
    CacheKeyModify -qs:utm*
    
    CacheKeyModify -qs:_ga
    
    ### marker DROPQS end ###
    
    </IfModule>
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    # END LSCACHE
    
    # BEGIN NON_LSCACHE
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    # END NON_LSCACHE
    
    # BEGIN WordPress
    
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    
    # dynamically generated, and should only be modified via WordPress filters.
    
    # Any changes to the directives between these markers will be overwritten.
    
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    RewriteBase /
    
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress
    
    # BEGIN ShortPixelWebp
    
    # The directives (lines) between "BEGIN ShortPixelWebp" and "END ShortPixelWebp" are
    
    # dynamically generated, and should only be modified via WordPress filters.
    
    # Any changes to the directives between these markers will be overwritten.
    
    # END ShortPixelWebp
    Thread Starter hagenb

    (@hagenb)

    and here is my .htaccess.bk:

    RewriteEngine On
    
    RewriteRule .* - [E=Cache-Control:no-cache]
    
    # BEGIN LSCACHE
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    <IfModule LiteSpeed>
    
    RewriteEngine on
    
    CacheLookup on
    
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    
    RewriteRule \.litespeed_conf\.dat - [F,L]
    
    ### marker MOBILE start ###
    
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    
    RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]
    
    ### marker MOBILE end ###
    
    ### marker CACHE RESOURCE start ###
    
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    
    ### marker FAVICON end ###
    
    ### marker DROPQS start ###
    
    CacheKeyModify -qs:fbclid
    
    CacheKeyModify -qs:gclid
    
    CacheKeyModify -qs:utm*
    
    CacheKeyModify -qs:_ga
    
    ### marker DROPQS end ###
    
    </IfModule>
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    # END LSCACHE
    
    # BEGIN NON_LSCACHE
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    # END NON_LSCACHE
    
    # BEGIN WordPress
    
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    
    # dynamically generated, and should only be modified via WordPress filters.
    
    # Any changes to the directives between these markers will be overwritten.
    
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    RewriteBase /
    
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress
    
    # BEGIN ShortPixelWebp
    
    # The directives (lines) between "BEGIN ShortPixelWebp" and "END ShortPixelWebp" are
    
    # dynamically generated, and should only be modified via WordPress filters.
    
    # Any changes to the directives between these markers will be overwritten.
    
    # END ShortPixelWebp

    There is nothing flashy in the .htaccess, so you must have installed a plugin that does this nonsense.

    Thread Starter hagenb

    (@hagenb)

    I disabled everything Yesterday. Is there a way for me to find out what could be setting this without having to go through each plugin?:D

Viewing 15 replies - 61 through 75 (of 111 total)

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