• Resolved jamieburchell

    (@jamieburchell)


    I am trying to resolve a long standing issue with W3TC where after a full cache purge, loading a page results in missing CSS caused by stylesheet references in the HTML that 404. It doesn’t always happen, and I’ve suspected this is due to some sort of race condition where visitors are hitting the site while the cache in being purged.

    Do you know what order the purge is done in? The way it currently fails, the CSS is missing even after repeatedly refreshing the page which make me wonder if the page cache is flushed before the CSS/JS cache? If so, is there a way to swap it around?

    Another thought would be if the plugin could not generate cache files if it is currently purging the cache.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jamieburchell

    Thank you for reaching out and I am happy to help!
    Without knowing some details about your setup and the website URL, I am unable to provide a specific answer.
    Can you please share the website URL, and also the theme and the settings used in the W3 Total Cache?

    Since this is not something that has been reported before, we need to investigate this and find out what in the W3 Total Cache may be responsible for this behavior.

    Thanks!

    Thread Starter jamieburchell

    (@jamieburchell)

    Hi @vmarko

    It might be related to this issue I opened a while back where the same was happening and also causing a PHP error. The PHP error has gone, but the behaviour observed is still there.

    These are Elementor/Elementor Pro websites using the Hello theme. Config here.

    It’s not one specific site, it’s something that generally happens.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jamieburchell

    As I can see you are using minify, so can you please

    disable minify in Perfirmance>General settings, save all settings and purge the cache and see if the issue persists?
    If the issue is gone, re-enable minify, and disable the settings in Performance>minify one by one (HTML minify, JS minify, CSS minify) and see which one might be causing the issue.
    Make sure to save all settings and purge the cache after each option is disabled.
    Thanks!

    Thread Starter jamieburchell

    (@jamieburchell)

    Hi @vmarko

    The problem is most of the time it works, only very occasionally I run in to this, and I don’t want to leave minify off for long periods of time. I can’t reproduce the error on demand hence the questions about order of purging. I’ll continue to investigate as time permits.

    Thread Starter jamieburchell

    (@jamieburchell)

    @vmarko

    I have an update for you. I ran in to this issue this morning and when I checked the stylesheets that are being referenced they return a 400 response with the text “400 Bad Request Please see?https://code.google.com/p/minify/wiki/Debugging.”

    After I purged the caches again, all was well.

    • This reply was modified 11 months, 1 week ago by jamieburchell.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Missing stylesheets referenced in HTML – race condition?’ is closed to new replies.