• I’ve been getting this error on an irregular basis for a site that’s hosted on WPEngine, running the Astra theme. When this error is occurring, it takes down most of the css on the page.

    The resource from “wp-content/cache/autoptimize/css/autoptimize_single_ed922440d1d89e0ac5757ffbfcaf3289.css?ver=ed922440d1d89e0ac5757ffbfcaf3289” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

    Let me know if you have any advice on solving this.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    that could happen if the file was not found (due to the autoptimize cache having been cleared manually or by another plugin/ theme through the API) and the 404 page being HTML instead of CSS.

    when this happens you typically have to clear the page cache (could be a plugin or at host level or 3rd party such as cloudflare).

    hope this helps,
    frank

    Thread Starter straitline

    (@straitline)

    Thanks for the response!

    I am reasonably certain that the autoptimize cache wasn’t cleared manually and I am unaware of any intended connections to the API.

    Are there known cases where plugins / themes would automatically try to clear the cache through the API?

    Or, could there be a conflict between the automptimize cache and the WPEngine cache or other meddling from WPEngine?

    And finally, could this same behavior be happening with the js on the page, but that might be less noticeable since it doesn’t immediately make the styling fail?

    Thank you!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Are there known cases where plugins / themes would automatically try to clear the cache through the API?

    Yes there are cases where plugins/ themes try doing so, best example being Divi (which I stopped allowing) which cleared the entire AO cache after each post/ page update. There are others, but I don’t keep track of those I’m afraid.

    Or, could there be a conflict between the automptimize cache and the WPEngine cache or other meddling from WPEngine?

    not that I know of no, but course not entirely impossible.

    And finally, could this same behavior be happening with the js on the page, but that might be less noticeable since it doesn’t immediately make the styling fail?

    yes, that *might* be possible.

    What could be a workaround is the following:
    1. ensure 404 fallbacks are active
    2. enable the “aggregate JS” and “aggregate CSS” options

    with that configuration AO will create “fallback” files (which generally is the aggregated JS & CSS for the homepage) and if the specific aggregated JS/ CSS is not found, the “fallback” files are used instead?

    hope this helps,
    frank

    Thread Starter straitline

    (@straitline)

    That’s helpful, thank you, Frank!

    Thread Starter straitline

    (@straitline)

    To confirm, the js started failing on this as well.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    have you switched to “aggregate CSS” and JS and is the 404 fallback option active?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news straitline ?

    Thread Starter straitline

    (@straitline)

    Sorry, I had those settings you recommended going but had to bail on the plugin since the js failure was so sporadic, it made it too difficult to debug and I was relying on user feedback, which wasn’t ideal.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘The resource from was blocked due to MIME type’ is closed to new replies.