• Resolved tripsoverpoland

    (@tripsoverpoland)


    I struggled with my blog’s cache – or LS Cache for a few days.
    Yesterday I disabled the cache in the LS Cache plugin, so I no longer had the HIT tag in the logs for the home page and the next few pages with entries.
    But it turned out that it was not enough for the home page and the next subpages with entries to look as they should, i.e. to be up to date, including the latest entry.

    Even removing these overlapping texts from the home page design didn’t help.
    On both computers and smartphones, some old version of the page kept downloading.
    This morning I decided to disable the LS Cache plugin altogether, which finally proved effective, so that pages would load from WordPress, and not from some cache. Now I have a correct view on all devices: computers and smartphones in many different browsers.
    What’s more, the performance without LS Cache is at a similar level as with LS Cache.

    Where is the problem with LS Cache, that despite disabling its cache, pages continue to load from it, and only after completely disabling the plugin is this cache effectively disabled?

    And I think I see where the problem lies. In yesterday’s copy of htaccess after disabling the cache in LS Cache there are these entries:

    # 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/debug/.*\.log$ - [F,L]
    RewriteRule \.litespeed_conf\.dat - [F,L]

    ### marker ASYNC start ###
    RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
    RewriteCond %{QUERY_STRING} action=async_litespeed
    RewriteRule .* - [E=noabort:1]
    ### marker ASYNC end ###

    ### 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 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! ##
    ### marker BROWSER CACHE start ###

    After disabling the LSCache plugin today, htaccess looks like this:
    #BEGIN LSCACHE
    #END LSCACHE
    #BEGIN NON_LSCACHE
    #END NON_LSCACHE
    So disabling the cache in LS Cache does not make the necessary changes to htaccess, hence you still see some old versions of blog pages on computers and mobile devices.

    I have an older complete version of htaccess with LS Cache working:


    # 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/debug/.*\.log$ - [F,L]
    RewriteRule \.litespeed_conf\.dat - [F,L]

    ### marker ASYNC start ###
    RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
    RewriteCond %{QUERY_STRING} action=async_litespeed
    RewriteRule .* - [E=noabort:1]
    ### marker ASYNC end ###

    ### 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 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! ##
    ### marker BROWSER CACHE start ###
    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType application/pdf A315576
    ExpiresByType image/x-icon A315576
    ExpiresByType image/vnd.microsoft.icon A315576
    ExpiresByType image/svg+xml A315576

    ExpiresByType image/jpg A315576
    ExpiresByType image/jpeg A315576
    ExpiresByType image/png A315576
    ExpiresByType image/gif A315576
    ExpiresByType image/webp A315576

    ExpiresByType video/ogg A315576
    ExpiresByType audio/ogg A315576
    ExpiresByType video/mp4 A315576
    ExpiresByType video/webm A315576

    ExpiresByType text/css A315576
    ExpiresByType text/javascript A315576
    ExpiresByType application/javascript A315576
    ExpiresByType application/x-javascript A315576

    ExpiresByType application/x-font-ttf A315576
    ExpiresByType application/x-font-woff A315576
    ExpiresByType application/font-woff A315576
    ExpiresByType application/font-woff2 A315576
    ExpiresByType application/vnd.ms-fontobject A315576
    ExpiresByType font/ttf A315576
    ExpiresByType font/otf A315576
    ExpiresByType font/woff A315576
    ExpiresByType font/woff2 A315576

    </IfModule>
    ### marker BROWSER CACHE end ###

    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE

    Here you can see the differences between having LS Cache fully enabled, only having the cache disabled in the plugin, and having the plugin disabled altogether.

    The mechanism of this plugin is currently not trustworthy and does not provide any significant improvement in the performance/speed of the pages.

    Moreover, minify options for JS and CSS do not work, similarly minify for HTML.
    I had to manually minify several JS and CSS scripts in the plugin: CookieYes | GDPR Cookie Consent
    because LS Cache does not do it, and another plugin Rank Math indicated a lack of minify in JS and CSS in this plugin.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tripsoverpoland

    (@tripsoverpoland)

    Today I checked the operation of LSCache with and without the MOBILE section in htaccess.
    If the mobile section is enabled (1) in htaccess, PageSpeed ​​shows 38, without this section (2) it is 56.

    ##marker MOBILE start## (1)
    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 MOBILE start## (2)
    #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##

    This is also confirmed by local Lighthouse in Chrome:
    without MOBILE – 77
    with MOBILE – 63
    Moreover, the enabled MOBILE section in htaccess recreates the old version of the page out of nowhere – and yesterday I disabled the cache in LSCache and the entire plugin in general (and then the page was displayed correctly as the current version), and today I enabled the LSCache plugin and its cache, cleared everything on the blog several times, and yet when the MOBILE section in htaccess is enabled, the old version of the page appears on mobile devices and in Lighthouse for calculations for mobile pages.

    Plugin Support qtwrk

    (@qtwrk)

    it looks like you have browser cache to cache page, without explicitly send out cache-control: no-cache, no-store, max-age=0, must-revalidate header, browser may attempt to cache your page

    you can try check the http response header, see what is the status code , value of x-litespeed-cache

    Thread Starter tripsoverpoland

    (@tripsoverpoland)

    I always check the operation of pages in incognito/in private mode in each browser (Chrome, Firefox, Opera, Samsung Internet or Brave), so that there is no data from my pages in the browser cache. What’s more, I delete everything from the browser cache even before entering incognito/in private mode, so that any old remnants of pages do not cause any problems.

    Now I have disabled the browser cache in LS Cache, so my htaccess looks like this at the moment:

    # 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/debug/.*\.log$ - [F,L]
    RewriteRule \.litespeed_conf\.dat - [F,L]

    ### marker ASYNC start ###
    RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
    RewriteCond %{QUERY_STRING} action=async_litespeed
    RewriteRule .* - [E=noabort:1]
    ### marker ASYNC 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 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

    But that didn’t help, and it contradicts the idea described in LS Cache with this option:
    “Browser cache stores static files locally in the user’s browser. Enable this setting to reduce multiple requests for static files.”
    I have a problem with the appearance of the texts on the pages, not with the images on the pages.

    Yesterday I decided to give the Litespeed Cache plugin one last chance – I uninstalled it and reinstalled it.
    I cleared the entire LS Cache cache many times.
    The view of the first page has improved and in theory each subsequent page of the blog with entries should look similar.
    Unfortunately, the second page does not look so good and is a page with a translator into other languages ​​(this blue and white box under the orange inscription blog.tripsoverpoland.pl), which was up to date 2-3 weeks ago.
    Please also note the texts superimposed right above the images of subsequent entries – this was also up to date a week ago, because then I deleted those few lines of text.
    The next 3rd page (and the next ones) is the same as the 2nd. The same errors and remnants of the translator.
    So LS Cache works very capriciously. Despite clearing the cache many times, it did not help with the view of even subsequent blog pages with subsequent entries. Without the LS Cache plugin, everything works and looks correct, but as I noticed: the load on the processors increases slightly, instead of an average of 2, 3-4 are loaded.

    The main question is – where does the LS Cache plugin and the entire server cache mechanism in combination with this plugin store these old versions of pages, or rather only their parts – a bit of the upper one with an overlapping text and the Google Translate window view preserved from the older version and a bit of the lower one with descriptive text formatted differently than it looks on the first page and on the project page of this page in WP?

    Clearing the entire LS Cache memory, even with a separate clearing of the REDIS database, does not improve the above situation.

    Only completely disabling this plugin restores the correct appearance of all pages.

    Thread Starter tripsoverpoland

    (@tripsoverpoland)

    I used one of the tips posted here:
    https://wordpress.org/support/topic/please-read-before-posting-89/
    and rolled back from version 6.5.2 to version 6.5.1 and so far all problems have gone away.

    So the problem occurred in version 6.5.2, which would indeed be confirmed, because previously there were no such problems with LS Cache.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disabling cache in LSCache plugin does not clear cache’ is closed to new replies.