Site Broken for Half Hour after Each Update

Hi! Each time I update my wordpress site the pages that are changed become broken and the CSS is blocked because the browser refuses to apply styles with the error "Refuse to apply style from ‘website root url’ because its MIME type (‘text/html’) is not a supported stylesheed MIME type, and strict MIME checking is enabled.

The issue does not happen if I am logged on to my website. The issue solves itself after half hour or so.

Only updated pages are broken.

I can purge the cache as many times as I want, the problem does not go away, it’s like Cloudflare takes half hour to flush and sync the mirrors.

Developer mode on and off won’t solve it either.

Turning off cache and optimizations doesn’t work either.

Commenting the line below on NGINX removes the MIME error but still, the CSS isn’t served for a few minutes after each update / cache purging.

add_header X-Content-Type-Options nosniff;

Are we expected to have our pages broken each time we update them for a few minutes?

Thanks in advance!

I’m on mobile right and can’t dig into the site, but I get that error when that CSS file is unavailable, so you get a 404 response, which is HTML. This makes me think that something is calling a File that no longer exists. Can you purge any caches on the server?

1 Like

Thanks!

My website should be working normally now, since it’s more than half hour since I last changed anything (it looks normal here naked or through VPN on desktop and using the F12 developer mode to emulate a mobile device, I don’t have a phone, only an Android tablet that works as a phone with Chrome).

Yes, it feels as if there’s a missing file after I update anything on my site and flush the cache, then it comes back to normal after a random amount of time (sometimes 5 minutes, sometimes half hour).

This issue is happening for months no matter which plugins I turn on or off (both with Apache, which I had before, and NGinx, which I use now, different hosts too). Funny that the website always updates correctly and instantly when I am logged in, the problem only happens to the general public and also robots like Google, I can see it scrapes the funny version of the site without CSS. Firefox and Edge also present the same problem.

My website is mostly designed for desktops, which are more than 90% of my audience. I don’t use AMP either, but I see some ad scripts load AMP content (I tried the AMP plugin months ago but the site becomes too oversimplified and with almost no ads if I do that, so I removed it).

I tried many things, on and off optimizations all together and individually on both my website and cloudflare. Cache on and off. Developer mode on and off. Created page rules etc.

No matter what I do, each time I update anything my website is partially broken for a few minutes.

Also, sometimes I update the website, refresh my website’s cache (autoptimize), purge Cloudflare’s cache, my site shows the new content right away while I am logged in, but the logged off version still shows the previous version (even after doing something as simple as adding/removing a sidebar widget).

It’s like my cache is not cleared up / refreshed right away, but after several minutes after “purging all”.

Trying to purge a specific page does not work faster either. Having cache completely disabled/bypassed does not work either.

Interestingly enough fiddling with my fastcgi settings on NGinx seemed to help a bit. I shortened the fastcgi_cache_valid 200 and 404 variables (less time serving old content) and also changed this: fastcgi_cache_use_stale error timeout invalid_header http_500 http_503 http_404 http_429

The last one did not seem to do much (it was set to updating before). I could turn it off but then if something goes wrong the website wouldn’t make use of stale cache, so I guess I will have to live with that for now.

Funny that I had the issue before when using Apache as well, even though it looks like it is an NGinx issue right now.

If anybody faces something similar I hope this helps. I still need to figure out the best way to make nginx refresh the cache without paying for their premium version (the modded nginx with built in purge isn’t around anymore, the old repository is broken and recompiling it is a pain and I could not make it work after working for days on it).

This topic was automatically closed after 14 days. New replies are no longer allowed.