• Resolved kapocskreativ

    (@kapocskreativ)


    Dear Wp Optimize,

    I’m using WP Optimize together with Divi, and I’m experiencing a recurring issue with my websites.

    From time to time, my sites randomly “break” — the layout shifts, styles are missing, and the design appears misaligned.

    Here is my current setup:

    * WP Optimize page caching is enabled
    * CSS and HTML minification are enabled (JavaScript minification is disabled)
    * Cache lifetime is set to 24 hours
    * Divi Critical CSS and Dynamic CSS and Divi Static CSS File generation are enabled on all sites

    Previously, I managed to stabilize things by disabling automatic updates in wp-config.php:
    define( 'AUTOMATIC_UPDATER_DISABLED', true );

    After that, everything worked fine for about 6 months. However, now the issue has returned randomly, even though:

    * I did not update anything
    * I did not make any changes
    * I did not log in to the sites

    I also checked with my hosting provider, and there were no recent PHP version updates.

    Additional context:
    * The websites are on separate hosting accounts, but with the same provider

    My question is:
    What could be causing these random layout and design issues, and how could I prevent it in the future for 100%?

    Thanks in advance for your help.
    Kapocs

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    It sounds like what’s happening is when DIVI is regenerating the static CSS files and the page is currently cached it’s pointing to CSS files that no longer exist.

    One thing I would recommend checking with the DIVI support team is to see if there is an action that we can hook into when the CSS regeneration happens so that we can trigger a cache purge.

    Let me know if they have something available and I can provide a code snippet that will trigger a cache purge when they regenerate the static CSS files.

    Thread Starter kapocskreativ

    (@kapocskreativ)

    Hi,

    Thank you for your answer! I reached out to the Divi support team as you recommended, and this is what they replied:

    “Sorry, I don’t have a hook to offer as we don’t offer coding/developer support here. They can refer to our developer’s doc or check this channel:

    https://www.elegantthemes.com/documentation/developers/, https://github.com/elegantthemes/create-divi-extension/issues

    Is this helpful for you in any way?

    Br,

    Kapocs

    Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks for sending that over. I wasn’t able to find anything in the documentation but I did find something in the changelog from a 2023 release.

    I just want to verify something, when this broken layout happens does purging the WP-Optimize Page Cache resolve the issue?

    Also, the next time you notice it can you send me a link to the page? I want to check the error console to see if what my theory is for the problem is correct.

    Thanks!

    Thread Starter kapocskreativ

    (@kapocskreativ)

    Hi,

    Yes, purging the cache resolves the issue. I used to experience this more often, but since I disabled all automatic updates for WordPress, themes, and plugins, I haven’t encountered it again. However, last week it happened again for no apparent reason (after 6 months).

    Now, I disabled all minification options in WP Optimize (as Divi has its own CSS caching) and left only page caching enabled in WPO. Hopefully, this will solve the issue.

    Br,

    Kapocs

    Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks so much for the update! Definitely keep me posted and if the issue returns I believe I found something we can hook into for when Divi regenerates its static CSS files so that we can tell WP-Optimize to purge the cache.

    Thanks!

    @jbgupdraft – This is still an issue. Did you ever solve it?

    Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi @jchambo,

    If my theory is correct and the issue is that Divi is regenerating their static CSS assets, can you try adding this snippet to your theme functions.php file or as a new php file in the mu-plugins folder? I was able to find a hook that Divi uses when their static assets are removed and can call our function to flush the cache.

    add_action('et_core_static_resources_removed', 'my_clear_wpo_cache');

    function my_clear_wpo_cache(){
    if(function_exists('wpo_cache_flush')){
    wpo_cache_flush();
    }
    }
Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.