• Hi! I have a weird issue with the current version of LiteSpeed and Divi 5 beta (latest version).

    Website is running ok but than at some time (I cannot discover what is triggering this) when opening a Woocommerce category the page fails to load with few 404 errors – it cannot find the dynamic css files located in the wp-content/et-cache/taxonomy directory. I checked and they are indeed missing – in fact the whole directory was absent. When I clear the LiteSpeed cache it is populated again and the website works. Clearing the browser cache before clearing the LiteSpeed one does not seem to fix it. I have to assume this is some conflict with Divi and LiteSpeed.

    I tried to exclude the whole et-cache directory from the settings, including adding no-cache headers for the css files located there via .htacccss but the problem still occurs at a random time. (I checked the headers for the files and they were showing private, no-cache, must-revalidate). I have excluded those files from combining. This issue appears to be happening only on Woocommerce categories which dynamic css files are located there.

    Any help in resolving this will be greatly appreciated! If you need any info feel free to ask. Thanks!

Viewing 15 replies - 16 through 30 (of 34 total)
  • Thread Starter Imagedonfloyd

    (@donfloyd)

    So far the combine looks to solve the issue (I guess there is no way to get 404 if there is not such css requested). I’m still wondering if those dynamic.css generations will force some frequent regeneration (I guess not as the combining process is a separate one and I don’t know what will trigger it’s regeneration) this The critical css was still requested (and I think generated) and causing the js error but I had to remove the injection js from the Divi source. Still not sure if this problem is limited to my setup – if you manage to replicate it feel free to share some insight. It is possible to be caused by some issue with my Litespeed plugin config or some other plugin.

    Plugin Support Imagelitetim

    (@litetim)

    @donfloyd I added and tested DIVI 5. I saw some things that are not working as expected, even with LSC disabled.
    So far I would wait until it get out of BETA and then daily use it.
    With V4 there were no issues with CSS regeneration from LSC.

    If you want we can close this topic and reopen/create a new topic later

    Thread Starter Imagedonfloyd

    (@donfloyd)

    Ok, thanks for the help! I hope they will work on fixing those issues.

    Thread Starter Imagedonfloyd

    (@donfloyd)

    Sorry but I have to update the topic with some bad news – this bug is happening even with the combine enabled! For some reason on the bugged category it loads the same combines css name but its content is different from the one loaded on the other pages. I don’t know how this is possible but maybe the combine is adding them on the fly – it does not find the dynamic css for this page and skips it (there are no 404 errors just broken css this time ). I’m really out of ideas – please advice me on some solution to mitigate this.

    Here are links to the files (strangely enough its the same name and version) – https://limewire.com/d/kwvAZ#fmIfPCy3bv as you can see the bugged one is missing around 200kb of css – probably the one from the dynamic one.

    *My last hope now is to disable the critical css from Divi (I don’t think it matters as it’s combined) and the display styles inline (without this option I got a broken style on the home page – probably due to the critical css not being rendered). I have to say that the bugged one happened after I browsed many categories so it triggers on some specific moment – once it triggers it’s fixed when cleaning the divi static css cache or Litespeed.

    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    Thread Starter Imagedonfloyd

    (@donfloyd)

    I see that on cache clean Divi is includes/builder/feature/DoNotCachePage.php feature to create such file to stop the caching. I’m not sure this has anything to do with this but they mentioned some issues with some plugins in the previous version which they say are fixed. I will continue to test with the current setup with no inline and no critical but I don’t have much hopes. If you have any idea if there is a way to fix this trough Litespeed please share as I am getting desperate. It’s such a bummer that they removed the dynamic css disable feature and I think there is really no adequate option that will keep working css on the website.

    Here is the code they have in this file regarding LiteSpeed if you think this can help.

    // Disable LiteSpeed Cache.
        $reason = esc_html__( 'Generating CSS', 'et_builder' );
        do_action( 'litespeed_control_set_nocache', $reason );

    Looks as it applies only when you regenerate manually not sure if it triggers on their random regeneration / removals.

    Since the beta Divi have actively recommended the version for live websites so this issue will probably be affecting a lot of people.

    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    Plugin Support Imagelitetim

    (@litetim)

    Plugin Support Imagelitetim

    (@litetim)

    OR: post_updated

    Thread Starter Imagedonfloyd

    (@donfloyd)

    Thanks! I added post_updated – should I add also edit_post or this is enough?

    I have to say that the removal of the dynamic css folders in the et-cache/taxonomy does not happen only when a product or category is edited. When it’s edited the whole folder is removed and after visiting a category is regenerated – but the individual category dynamic css folders inside are removed at some point, even if there is no editing – so I guess the problem can still occur even if the cache is purged when a product is edited. I don’t really know the logic behind those dynamic.css purges as they happen very frequently – I can have let’s say 20 folders inside but after some time I can get 3-4 in it. Really weird behavior – If this is not resolved I will write to Divi to see if they can do anything about it. I will report if I encounter the bug again with this fix – if you have any other suggestions please write. *I will monitor the number of folders and date of modification to see if they reduce without any action in the backend (maybe the critical css or the inline styles generator forces the clearance of the category folders for some reason or might be some other inner Divi logic to remove them even if they are not manually purged or changed).

    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    Thread Starter Imagedonfloyd

    (@donfloyd)

    What makes this weirder is that all those dynamic css files are identical for all the categories (at least in my case) which is making their generation even more unnecessary. If everything fails I will have to brute force disable it in some way and add it as a static file…

    *Edit – With AI I analyzed the DynamicAssets.php and among other things is said that this code is responsible for the et-divi-dynamic.css and et-divi.dynamic-late.css located in those taxonomy folders.

    $files = (array) glob( "{$this->_cache_dir_path}/{$this->_folder_name}/et*-dynamic*{$this->_tb_prefix}*" );
    foreach ( $files as $file ) {
    if ( ! et_()->includes( $file, '-late' ) ) {
    $generate_assets = false;
    break;
    }
    }

    if ( $generate_assets ) {
    // Regenerates if files are missing
    $this->generate_dynamic_assets();
    }

    If you think something in it can conflict with the Litespeed or can be easily fix please share. Thanks!

    This one has something to do with the taxonomy handling 
    // In get_folder_name()
    if ( DynamicAssetsUtils::is_taxonomy() ) {
    $queried = get_queried_object();
    $taxonomy = sanitize_key( $queried->taxonomy );
    $folder_name = "taxonomy/{$taxonomy}/" . $this->_object_id;
    }
    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    • This reply was modified 1 week, 4 days ago by Imagedonfloyd.
    Plugin Support Imagelitetim

    (@litetim)

    @donfloyd does the setting change helped?

    Thread Starter Imagedonfloyd

    (@donfloyd)

    I have added post_updated (Should I add edit_post too?). I’m running with no critical and inline css – with combine and minify enabled + the new purge. So far I haven’t encountered the bug but as it happens quite rarely I will continue testing (last time it took quite a lot of category opening to appear with the combine). I checked and it looks the constant purging of those items in the taxonomy is not unique to Divi5 and it looks that on Divi4 they are randomly refreshed even with no updates on posts / products. I suspect some race conditions occur at times when Litespeed caches the page before or at the moment of the css generation but I’m not a developer so my insight is very limited. It’s weird that refreshing the page still produces the broken layout as what it looks in the code there are checks that run to verify and re-create it. I still can’t grasp the logic behind the dynamic and the dynamic-late regeneration in the code I pasted from the DyamicAssets.php and the relationship between those two. As I was running the website on an apache server for quite some time with no issue I have to believe that Litespeed comes in to play somewhere. As I mentioned I have tried to exclude the directory from caching but that didn’;’t help (I guess this has to do more with the page caching rather than the css files themselves) . Thanks for help.

    Thread Starter Imagedonfloyd

    (@donfloyd)

    I’ve written to Divi and reported the bug & I will write if they respond in a meaningful way. Haven’t had the issue since enabling the purging trigger but as the bug occurs rarely I am still not convinces it won’t happen again.

    Divi purges those dynamic css very frequently without any change in the backend or update in the css itself (reason uknown) so LiteSpeed will definitely can serve a cached page linking to missing file. LiteSpeed serves most of the time a cached version of though so even if it’s not there it still loads it from the cache. The problem occurs I guess when the page is cached but the css is not served either from the memory or disk cache (or the browser cache). Is this a expected behavior from LiteSpeed – to serve cached page but to request the css from the server? As those dynamic css files are different (although identical) it has to cache them individually. Do you think the purge setting will help in those scenarios where the dynamic css is being removed without any post change? Some rare race between LiteSpeed caching and Divi is removing and than regenerating might be causing this too. Thanks again for your help.

    Thread Starter Imagedonfloyd

    (@donfloyd)

    Hi again! Some updates on the issue:

    I’ve been in touch with the Divi support and I’ve provided them with the information that I have and I am expecting some response soon.

    What I’ve learned so far: Most likely the bug scenario is: LiteSpeed caches the page with link to the dynamic.css – Divi meanwhile has cleared the file – variant 1 Lite speed loads a cached version of the css – Everything is ok –variant 2 – the bug happens – LiteSpeed loads cached page but do not load cached css but requests the missing file. (Please tell me when this scenario can happen – why LiteSpeed might serve a cached page but no cached css file)

    Reasons for divi taxonomy deletion without any edits of posts or any backend activity

    I’ve included currently a script that detects when the dynamic css is cleaned – it looks it is purged on any post change – which by itself will cause issue as LiteSpeed will not clean the cache on those occasions (that’s the reason why your solution to purge all on change will work on this scenario). This is not very practical though. The dynamic css purge happens even on unrelated posts like orders.

    The problem with my setup is that Divi dynamic css is cleaned even without any edits – probably cause is some 3rd party plugin triggering in through some cron / scheduled action or other automatic method. Main suspect right now is BeRocket Ajax Filters – I will report if this is confirmed.

    Conclusion and questions

    Even if I resolve the cache clearing that is not based on manual change the fact that Divi cleans its cache on every change is a bit of a problem when LiteSpeed does not do that by default. Moreover even if I set up the purge all action on post update Divi has an automatic purge that occurs in 6 days or something. So even than this purge can happen and LiteSpeed will not know or purge its cache.

    Questions: Do you know what can cause LiteSpeed to have missing dynamic css cached file when loading a cached html containing the broken dynamic css and can this be prevented is some way. If this is not happening the bug will not occur as usually even if the cache folder is missing Litespeed serves the cached one and it’s ok. Once this fails the broken page gets cached and stays broken until purge.

    Thread Starter Imagedonfloyd

    (@donfloyd)

    Response from Divi Support:

    I took a quick look at your site, and I was able to see a similar issue on the first view of the website.
    Here’s a short video:

    https://somup.com/cTXuieR2mo

    However, at the same time, using ?nocache in the URL, the same page shows fine.

    Indeed, this is just caching for Litespeed, which still has old Divi files where Divi’s CSS files got updated, and didn’t clear the LiteSpeed plugin cache serving the old CSS files, which gave 404.

    It’s hard to tell at the moment what exactly triggered the Divi’s CSS file to change.

    When Divi’s Cache is cleared, it will also clear the cache of Litespeed based on this script used on the Divi5

    Divi/core/components/int.php file:

    Image

    And the Litespeed cache cleared is called from the Divi’s native “et_core_clear_wp_cache” function.

    Based on the function, if the Post_ID is sent while clearing cache, it will only clear cache of that post; else, it will clear all Litespeed cache.

    According to the issue that you are having which is only happening with the taxonomy pages, I’m afraid that the Support team doesn’t have any information to share.

    However, I’ll share all the information I have gathered from this conversation with our dev team and will request to review the Litespeed cache clearing system along with Divi’s cache and investigate on possible causes for this kind of issue.

    // As I expected pretty much the issue is that Divi does not force LiteSpeed to clean when it cleans. They provided a code that supposedly should this but I guess it does not work as expected. Can you tell what might cause it to not function?

    Thread Starter Imagedonfloyd

    (@donfloyd)

    The code they are referring to in the Divi/core/components/int.php file: (image was not pasted)

    	// LiteSpeed Cache v3.0+.
    if ( '' !== $post_id && has_action( 'litespeed_purge_post' ) ) {
    do_action( 'litespeed_purge_post', $post_id );
    } elseif ( '' === $post_id && has_action( 'litespeed_purge_all' ) ) {
    do_action( 'litespeed_purge_all' );
    }
Viewing 15 replies - 16 through 30 (of 34 total)

You must be logged in to reply to this topic.