• Resolved SJW

    (@whitsey)


    I use litespeed on a number of sites and I am having a recurring issue with most of them.

    The site loads ok but after a while – a week or so, everything seems to load out of alignment as if some of the css is missing. I have also noticed as well that the console prints our the following ONLY when the css is missing and the pages are out of alignment:

    [LiteSpeed] Start Lazy Load Images
    bin-sizes-prices/:61 []
    bin-sizes-prices/:61 [LiteSpeed] Start Load JS Delayed
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript" data-src=​"https:​/​/​www.googletagmanager.com/​gtag/​js?id=UA-30977904-2">​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript">​…​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript" data-src=​"/​wp-includes/​js/​jquery/​jquery.min.js" id=​"jquery-core-js">​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript">​…​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript">​…​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript">​…​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script type=​"litespeed/​javascript">​…​</script>​
    bin-sizes-prices/:61 [LiteSpeed] Load <script data-optimized=​"1" type=​"litespeed/​javascript" data-src=​"/​wp-content/​litespeed/​js/​0a3b8dfc1cf5228f25ab5e27a78d241d.js?ver=f1f12">​</script>​
    0a3b8dfc1cf5228f25ab5e27a78d241d.js?ver=f1f12:2 JQMIGRATE: Migrate is installed, version 3.4.1

    I can generally fix it by issuing a hard refresh (<ctrl> <shift> R) or clearing the cache but I am guessing this software isn’t designed requiring a manual cache refresh once a week? I dont know what to do apart from disabling all the features that are the reason I use LiteSpeed

    • This topic was modified 1 year, 4 months ago by SJW.

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Support litetim

    (@litetim)

    @whitsey
    Let’s break you response and clarify some things:
    – When you press CTRL + SHIFT + R you clear BROWSER cache. This cache is built at a moment by browser and is going to be served into your page. It has a x time of life. See this section: https://docs.litespeedtech.com/lscache/lscwp/cache/#browser-tab for a few details
    – In console the messages appears because you activated 2 settings:
    [LiteSpeed] Start Lazy Load Images => Lazy Load from https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images and that message is confirmation it is firing and doing the things
    [LiteSpeed] Start Load JS Delayed => Load JS Deferred is set to Delayed https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images which loads JS on page interaction(move mouse, click or touch). The messages are for logging what it loaded.
    – If the messages appear only after x time maybe after clearing cache there is a JS error. Please check the console and try to figure out what happens. This can give you a hint from where to start: https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/

    Thread Starter SJW

    (@whitsey)

    I’m aware of what CTRL + SHIFT + R does – that’s why I did it to clear the cache and when it cleared it work. My problem is – why is a bad version of the site ever being cached in the first place?

    Could it be related to Litespeed recompiling the css? It recomiles and updates the css files and my cache is referencing the old compiled css that is now outdated?

    Plugin Support qtwrk

    (@qtwrk)

    it seems you have enabled cloudflare page cache , this will create some issue with our plugin

    for example the minified/combined JS/CSS file may change , and when CF caches old page, it will end up in 404 error

    once you do hard refresh , it will bypass CF cache for that request and get correct JS/CSS resources

    please try disable CF page cache , see how it goes

    Thread Starter SJW

    (@whitsey)

    Ok, So is this a known issue – CF does not work with LiteSpeed? I have a few dozen sites using LiteSpeed (recently installed) with CF – We’ve previously used W3TC with CF but have moved all sites over to LiteSpeed for compatibility with a LiteSpeed web server. But CF is a no-no?

    We use CF mainly to help reduce server load and improve load times.

    Can you recommend the optimal configuration of WordPress/LiteSpeed/CF.

    Thanks

    You can add your Cloudflare domain under CDN settings at very bottom by adding your API key, email and domain. Then once that is added a purge Cloudflare option is added. This is what I do and never use QUIC.cloud because it slow and clunky to use. Takes forever for large sites to finish optimizing images and VPI otherwise and almost always runs out of bandwidth.

    Plugin Support qtwrk

    (@qtwrk)

    we treat CF as static resources (such as JS, CSS or IMG files ) cache , in that case, it will work , but if you cache the page itself at CF side , it will create problem

    Thread Starter SJW

    (@whitsey)

    we treat CF as static resources (such as JS, CSS or IMG files ) cache , in that case, it will work , but if you cache the page itself at CF side , it will create problem

    Isn’t that what CF does by default? I don’t cache the page in CF – it jus does it doesn’t it?

    Plugin Support qtwrk

    (@qtwrk)

    the http response header shows it is cached , maybe you enabled APO ?

    Thread Starter SJW

    (@whitsey)

    Aha. Yes, this customer has actually activated APO. Got it. But this has happened on other sites without APO – I will wait until the problem reoccurs on another site without APO

    Thread Starter SJW

    (@whitsey)

    Actually, there is another site with a similar issue: shelterme.org.au – APO def not activated.

    This uses admin-ajax to navigate options. This works fine for a while but after a period of time (when the cache expires) the admin-ajax returns an error indicating not allowed. I clear the cache and perform a CTRL + SHIFT + R and it starts working again.

    Plugin Support qtwrk

    (@qtwrk)

    you can enable CF page even without APO , please check the http response header as my previous screenshot to check if CF page cache is on or not

    Thread Starter SJW

    (@whitsey)

    I did already before posting.

    The cf-cache-status: DYNAMIC response header which indicates that the requested resource was not served from Cloudflare’s cache but instead fetched dynamically from the origin server.

    Plugin Support qtwrk

    (@qtwrk)

    which domain are we talking about now ?

    and please aware, in dev tool if you check “disable cache” , CF will return dynamic which is not normal response to normal visitors

    Thread Starter SJW

    (@whitsey)

    Actually, there is another site with a similar issue: shelterme.org.au – APO def not activated.This uses admin-ajax to navigate options. This works fine for a while but after a period of time (when the cache expires) the admin-ajax returns an error indicating not allowed. I clear the cache and perform a CTRL + SHIFT + R and it starts working again.

    Plugin Support qtwrk

    (@qtwrk)

    that’s typically a nonce issue , you can try search keyword omg_sp_lookup , to get to the code where/how the nonce is generate , with the nonce name you can enable ESI nonce

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

The topic ‘caching keeps breaking site’ is closed to new replies.