Title: Missing stylesheets referenced in HTML – race condition?
Last modified: September 23, 2024

---

# Missing stylesheets referenced in HTML – race condition?

 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/)
 * Following up from the issue here that has been marked as resolved (not sure why)
 * [https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition/](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition/)
 * I would really appreciate some help getting to the bottom of it.
 * There’s also a [GitHub issue opened at Elementor about it](https://github.com/elementor/elementor/issues/27320).
 * Recap: When flushing Elementor’s CSS cache and then W3TC’s caches, sometimes 
   a page is delivered broken (missing minified CSS files). I can reproduce this
   quite a lot.
 * Once that happens, the only way to “fix” it is to keep flushing W3TC’s caches
   until Elementor has the opportunity to generate the necessary CSS files that 
   W3TC can then minify and serve.
    -  This topic was modified 1 year, 6 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
    -  This topic was modified 1 year, 6 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
    -  This topic was modified 1 year, 6 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).

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

1 [2](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/4/?output_format=md)
[5](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/5/?output_format=md)
[→](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/2/?output_format=md)

 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031368)
 * Topic also raised here: [https://wordpress.org/support/topic/whats-the-fix-page-cache-processed-content-filter/](https://wordpress.org/support/topic/whats-the-fix-page-cache-processed-content-filter/)
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031505)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/)
 * Thank you for reaching out and I am happy to help!
   It’s not easy to replciate
   the issue, given that there are a lot of variations when it comes to the setup,
   themes, other plugins, etc.I peresonaly was not able to replciate this. To confirm,
   besides the Page Cache, the Minify is also used in this case? Can you cofirm 
   this?I was wondering if the issue still occurs if Minify is not enabled so we
   can determine if the probelm with the CSS Print Method is related to minify and
   Externa/Internal method in the Elementor settings
 * If the issue continues to persists, please also do the same with Page Cache, 
   and let me know if besides the W3 Total Cache, you are using any other layer 
   of caching.
 * Thanks!
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031519)
 * Hi [@vmarko](https://wordpress.org/support/users/vmarko/)
 * The issue does not happen if I turn off the CSS minification setting in W3TC.
 * I am not using any other level of cache except those caches in W3TC (object cache(
   memcached), Page Cache, CSS/JS minification).
 * Elementor’s CSS print method is set to External.
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031542)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/)
 * Thank you for your feedback and thank you for testing this so we can narrow this
   down.
   Let me make some tests and see how this behaves and just a followup question,
   is the option “Eliminate Render-blocking CSS” enabled in the Performance>Minify
   >CSS settings?
 * Thanks!
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031556)
 * Hi [@vmarko](https://wordpress.org/support/users/vmarko/) it’s not enabled (free
   version only)
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18031626)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/)
 * Thank you for the information
 * I’ll make sure to check this and get back to you once I havbe more details.
   Thanks!
 *  [T4ng](https://wordpress.org/support/users/schwipps/)
 * (@schwipps)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18032756)
 * Hi,
 * I face the same issue.
 * In my case, this occurs with or without W3TC CSS minication, internal or external
   Elementor CSS embedding, and combination of those.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18032779)
 * I now have a local test environment where I can reproduce this issue. One person
   accessing a single URL. The configuration is the same as in production. When 
   I clear Elementor’s CSS and purge the W3TC cache, what I am seeing on the first
   page load is a broken page with missing styles.
 * The HTML references these stylesheets. The ones that start “post-X.css” do not
   exist (404). Elementor never created them in that directory.
 *     ```wp-block-code
       <link rel="stylesheet" href="https://example.local.test/app/cache/minify/b9df7.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/7205b.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/4de51.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/24907.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/48605.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/9e7ea.css?x47804" media="all" /><link rel='stylesheet' id='elementor-post-8-css' href='https://example.local.test/app/uploads/elementor/css/post-8.css?x47804&amp;ver=1727166622' media='all' /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/7c062.css?x47804" media="all" /><link rel='stylesheet' id='elementor-post-23-css' href='https://example.local.test/app/uploads/elementor/css/post-23.css?x47804&amp;ver=1727166622' media='all' /><link rel='stylesheet' id='elementor-post-19-css' href='https://example.local.test/app/uploads/elementor/css/post-19.css?x47804&amp;ver=1727166624' media='all' /><link rel='stylesheet' id='elementor-post-3118-css' href='https://example.local.test/app/uploads/elementor/css/post-3118.css?x47804&amp;ver=1727166626' media='all' /><link rel='stylesheet' id='elementor-post-3076-css' href='https://example.local.test/app/uploads/elementor/css/post-3076.css?x47804&amp;ver=1727166626' media='all' /><link rel='stylesheet' id='elementor-post-2210-css' href='https://example.local.test/app/uploads/elementor/css/post-2210.css?x47804&amp;ver=1727166627' media='all' /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/0acef.css?x47804" media="all" /><link rel="stylesheet" href="https://example.local.test/app/cache/minify/4ba1b.css?x47804" media="all" />
       ```
   
 * Other times, I’m seeing Elementor still not outputting the CSS files, but the
   HTML served by W3TC references minified files that are empty:
 *     ```wp-block-code
       <link rel="stylesheet" href="https://example.local.test/app/cache/minify/55638.css?x76291" media="all" />
       ```
   
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18033027)
 * I can also now replicate the issue without W3TC Minify being enabled – just the
   Page Cache. W3TC serves HTML files with references to Elementor stylesheets that
   do not exist. When that happens, refreshing the page appears to get Elementor
   to regenerate the missing stylesheets. Note I do not have the HTML cached in 
   the browser. If I had, Elementor wouldn’t be generating the stylesheets on browser
   refresh.
 * It seems that W3TC doesn’t wait for or allow Elementor to generate its CSS files
   before attempting to either minify them or output references to them straight
   in the HTML.
    -  This reply was modified 1 year, 6 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18033791)
 * [@vmarko](https://wordpress.org/support/users/vmarko/) [@schwipps](https://wordpress.org/support/users/schwipps/)
   I’ve done as much debugging as I can on this. Pretty much spent the entire day
   trying to figure out what’s going on. I’ve updated [this ticket](https://github.com/elementor/elementor/issues/27320#issuecomment-2370755941)
   with my findings. I can reproduce the issues pretty consistently after a couple
   of tries with just the Enhanced Page Cache enabled from W3TC.
 *  [T4ng](https://wordpress.org/support/users/schwipps/)
 * (@schwipps)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18033823)
 * We use the Redis page cache method.
    -  This reply was modified 1 year, 6 months ago by [T4ng](https://wordpress.org/support/users/schwipps/).
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18033950)
 * Funny, I can’t reproduce it using Memcached method (I don’t have Redis installed).
   We use Disk Enhanced to remove the overhead of PHP > Redis/Memcached and serve
   the built HTML files directly from disk. It even works most of the time 🙂
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18034148)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/)
 * Thank you for valuble information. 
   We are setting up a platform to test all 
   of this so thank you for your patience.Thanks!
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18034460)
 * Thanks [@vmarko](https://wordpress.org/support/users/vmarko/)
 * If there’s anything I can do to help let me know.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/#post-18035529)
 * [@vmarko](https://wordpress.org/support/users/vmarko/) While testing locally 
   I noticed that if I remove the check in the code where it allows the old cached
   page to be served if it’s within the last 30 seconds, it fixes the issue with
   missing stylesheets because the page is regenerated. I’m not really sure what
   the purpose of serving that stale cache is. Interestingly though, in production,
   if I clear the page cache and refresh I get served the new page.

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

1 [2](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/4/?output_format=md)
[5](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/5/?output_format=md)
[→](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/2/?output_format=md)

The topic ‘Missing stylesheets referenced in HTML – race condition?’ is closed to
new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [css](https://wordpress.org/support/topic-tag/css/)

 * 66 replies
 * 3 participants
 * Last reply from: [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/missing-stylesheets-referenced-in-html-race-condition-2/page/5/#post-18283508)
 * Status: not resolved