• Resolved Suki

    (@sukinoz)


    Possible CSS Minify cache-busting issue with GeneratePress and other plugin CSS

    Hi,

    We would like to report a possible cache-busting/invalidation issue related to LiteSpeed Cache → Page Optimization → CSS Minify.

    We are using WordPress with GeneratePress and some additional plugins. The issue is not limited to GeneratePress: we have observed the same behavior both with GeneratePress-related CSS, such as typography styles, and with CSS files loaded by another plugin.

    Observed behavior:

    1. With LiteSpeed Cache enabled and CSS Minify ON, some mobile browsers continue loading previous styles.
    2. Opening the same page in an incognito/private tab loads the correct updated styles.
    3. Clearing the browser cache/data on the affected mobile device also makes the updated styles appear.
    4. Using:
    ?LSCWP_CTRL=before_optm
    

    loads the correct updated styles.
    5. If we add generatepress to Page Optimization → Tuning → CSS Excludes, the GeneratePress-related issue is resolved.
    6. If we add the affected plugin CSS file to CSS Excludes, that plugin CSS issue is also resolved.
    7. Purging LiteSpeed cache alone does not reliably fix it for already affected mobile browsers.

    This makes us think the problem may not be invalid CSS output, but rather that the optimized/minified CSS generated by LiteSpeed is not getting a new URL/version/cache-key when the underlying CSS changes. As a result, browsers that already cached the previous LiteSpeed-generated CSS continue using it.

    In other words, the minified CSS itself may be valid, but its cache invalidation/cache-busting seems unreliable in this case.

    Could you confirm whether CSS Minify takes the original CSS version/query string/file modification time into account when generating the optimized CSS file URL/cache key?

    Is excluding GeneratePress and the affected plugin CSS files the recommended workaround, or is there a better way to force LiteSpeed to generate a new optimized CSS URL when the original CSS changes?

    Thanks.

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

    (@litetim)

    @sukinoz please send a report to Litespeed and share the ID generated. How to create and send report: https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#get-a-report-number
    Thank you

    Thread Starter Suki

    (@sukinoz)

    Failed to request via WordPress: [server] https://api.quic.cloud [service] wp/report

    Plugin Support litetim

    (@litetim)

    @sukinoz Do you have some firewall in WP OR on server level?
    Or is there a code that will limit/stop API requests?

    Thread Starter Suki

    (@sukinoz)

    In WP sure not. In wp-config either.

    Maybe server level?

    Plugin Support litetim

    (@litetim)

    @sukinoz depends on your setup or what hosting is providing you.

    Plugin Support litetim

    (@litetim)

    @sukinoz there is another way to get report: go to LSC => Toolbox => Report => copy the report and share it on a service that will allow to create a link with the content.
    Share just the link from: https://pastebin.ubuntu.com/ https://pastebin.com/ 

    This will allow me to help you with CSS minify error.
    But the connection issue must be debugged on server level.

    Thread Starter Suki

    (@sukinoz)

    I should mention that the temporary solution has been to exclude those CSS files (as you can see)

    https://pastebin.com/hxCkXCtn

    Plugin Support litetim

    (@litetim)

    @sukinoz

    CSS issue: I see what do you mean. You added wp-content/uploads/generatepress That is something generatepress should clear when data is changed. Try to do a Purge – All after changing data.

    For server connection: I see you do not use QC service. For us is not a problem, but when you decide to use them be aware of the report not being able to be sent and look for what is blocking them: might be a plugin, custom code, htaccess code or server setting.

    Thread Starter Suki

    (@sukinoz)

    It seems I did not explain myself clearly.

    What I was trying to say is that you should ignore that part, because that is precisely what solves the problem. The issue I am reporting happens when I do not use any exclusions.

    Today the same issue happened again on another website:

    1. The website is updated and the cache is cleared, but on mobile the old version of the website is still shown, except when using an incognito tab or after clearing the mobile browser cache.
    2. CSS Minify is disabled, with no exclusions configured, the cache is cleared again, and the issue is solved.
    3. CSS Minify is enabled again, still with no exclusions configured, and the old version of the website starts loading again on mobile.

    So the point is not that the exclusions are causing the issue. The opposite: exclusions or disabling CSS Minify are what prevent the issue. The problem appears when CSS Minify is enabled without exclusions.

    Thread Starter Suki

    (@sukinoz)

    (Sorry, wrong post)

    • This reply was modified 3 weeks, 4 days ago by Suki.
    Plugin Support litetim

    (@litetim)

    @sukinoz
    from my point of view adding the exclude is the good way to do.
    please share a report ID
    We will look into the issue together with devs and see if we can change something to help you

    • This reply was modified 3 weeks ago by litetim.
    Thread Starter Suki

    (@sukinoz)

    from my point of view adding the exclude is the good way to do.

    Sure. Disabling CSS Minify works too! hehehehe. “Dead dogs don’t bite”

    please share a report ID

    I’ve already shared it with you

    Plugin Support litetim

    (@litetim)

    @sukinoz the sharebin link has expired.
    Report creation is working, please share the ID generated.

    Thread Starter Suki

    (@sukinoz)

    Hello again.

    It now seems that the problem isn’t resolved by disabling ‘CSS Minify’ and clearing the cache.

    If we disable the LiteSpeed plugin, it loads fine on mobile.

    If we enable the LiteSpeed plugin (even with CSS Minify off and Purge All Cache), it displays the old version on mobile again (but it loads fine on desktop).

    If we open it in incognito mode on mobile, it loads fine.

    Plugin Support litetim

    (@litetim)

    @sukinoz
    As a rule, please open the site in incognito and test there
    Also from your mobile, clear browser data and see what happens.

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

You must be logged in to reply to this topic.