• Resolved partynoparty

    (@partynoparty)


    I have already resolved this issue, but I wanted to bring it to your attention in case you have another / better solution.

    We recently switched hosts and shortly after started getting the following errors in relation to my autoptimize files:

    Failed to load resource: the server responded with a status of 403 ()

    Refused to apply style from ‘https://emriver.com/wp-content/cache/autoptimize/css/autoptimize_37c952cdd3200b0518a7dfc174ae1bfe.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    I’ve seen this error in the past when enabling or disabling plugins and it was usually resolved by clearing my cache, via W3 Total Cache. But clearing the cache no longer seems to be working. I thought it might be related to my browser cache, but clearing my browser cache also did not resolve the issue.

    Solution:

    We were able to fix the problem by removing these lines from our htaccess file:

    # RewriteCond “%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” -f
    # RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” [L]

    Please let me know your thoughts on this issue and if there might be something else going on that I missed.

    • This topic was modified 4 years, 6 months ago by partynoparty.

    The page I need help with: [log in to see the link]

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

    (@vmarko)

    Hello @partynoparty

    Thank you for your inquiry and for providing the details about the issue.
    Stylesheets should have a MIME type of text/CSS. Your server is serving up a MIME type (‘text/html’) document (probably a 404 NOT FOUND error page) when it should be serving a CSS document. So the issue is with the CSS file.
    And as you can see the lines you removed are the Rewrite condition for page caching (HTML).
    Let me investigate this and I’ll get back to you as soon as I have a correct answer.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @partynoparty

    I\ve spoken with the team and apparently there is a conflict between W3 Total Cache Page Caching and AO cache.
    As I’ve stated above Stylesheets should have a MIME type of text/CSS. Your server is serving up a MIME type (‘text/html’) so the problem is with the CSS file.
    Thank you!

    Thread Starter partynoparty

    (@partynoparty)

    Thank you for the response. I am curious, the lines that I removed from the htaccess file, would they have been written into the file by W3 Total Cache, or would they have to have been manually added to the htaccess file a web developer? I’m afraid I only recently took over management of this web page, so I don’t know the full history and what the previous developers may have done.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @partynoparty

    Yes, those should be written once Page Cache Disk enhanced is enabled.
    In some rare cases, it does not apply automatically so it needs to be Copied from the Perfromance>Install>Rewrite Rules (based on active settings)
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Failed to load resource error in conjunction with autoptimize’ is closed to new replies.