W3TC & autoptimize – “Refused to apply style”
-
Similar to as mentioned here: https://www.ads-software.com/support/topic/failed-to-load-resource-the-server-responded-with-a-status-of-403-6/
Errors & warnings as they appear in the console:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "https://cdn1.domain.com/wp-content/cache/autoptimize/css/autoptimize_1e1ae9672ab870fae1ea2a5a9b0c1ab5.css". (index):1 Refused to apply style from 'https://www.domain.com/wp-content/cache/autoptimize/css/autoptimize_1e1ae9672ab870fae1ea2a5a9b0c1ab5.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. autoptimize_b598d62d948cc70a9aef58605e043bbc.js:2 JQMIGRATE: Migrate is installed, version 3.3.2 (index):1 The resource https://www.domain.com/wp-content/themes/goya/assets/icons/theme-icons/fonts/et-icon.woff?rkbvvo was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate <code>as</code> value and it is preloaded intentionally. (index):1 The resource https://www.domain.com/wp-content/themes/goya-child/fonts/FuturaStd-Book.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate <code>as</code> value and it is preloaded intentionally.
The above do not normally appear. They only appear in the following situation.
1. You go to W3TC and purge all caches.
2. If you notice that the autoptimize cache was also deleted then the problem happens.
If the autoptimize cache was not deleted, the problem does not happen.
You can empty the autoptimize cache also to force this to happen.
3. Immediately you CTRL-F5 your home page.
4. The above messages appear
5. 4x autoptimize.js files appear
autoptimize_xxx.js 301 cdn1.domain.com script/redirect (index)
red autoptimize_xxx.js 410 https://www.domain.com script (cdn1.domain.com/…/autoptimize_xxx.js)
autoptimize_xxx.js 301 cdn1.domain.com script/redirect (index)
autoptimize_xxx.js 200 https://www.domain.com script (cdn1.domain.com/…/autoptimize_xxx.js)
6. 2x autoptimize.css files appear
autoptimize_xxx.css 301 cdn1.domain.com stylesheet/redirect (index)
red autoptimize_xxx.css (canceled) https://www.domain.com stylesheet (cdn1.domain.com/…/autoptimize_xxx.css)
7. When I right click the js and css files and open in new tab, I can see the contents of my /journal page. Weird.No fallback files show up.
When you CTRL-F5 again after a few seconds everything is back to normal.How to avoid this problem:
1. Follow step 1 & 2 above.
2. Start your stop watch and wait 15s. Do CTRL-F5 on your home page.
The problem does not happen!!
- The topic ‘W3TC & autoptimize – “Refused to apply style”’ is closed to new replies.