• Resolved Ashish Jangra

    (@ashishjangra-1)


    Hi Team,

    I am using AO, It works well, But many time when we open our site on Private Window/ Incognito mode. CSS file didn’t load so all styling of the website not loading properly. After inspecting in Web developer toolbar I found autoptimize css is returning 404 error. But once I refresh it again, it works.

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

    (@optimizingmatters)

    Autoptimized files (by default) are saved as static .JS or .CSS files, so when those files are requested autoptimize (the PHP code of the plugin) isn’t active any more. If sometimes files are returned OK and sometimes the same files are “not found” then there seems to be a problem on a webserver level?

    frank

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    That is true that the css files and are static and trying to be served by web server system but the reason it’s getting the 404 is because autoptimize is sometimes looking for a css files that doesn’t exist. For some reason it’s setting to look for a file like autoptimize_95dfd8123bebf248de9c1dc7ca92344a.css when the file on the server it had created is autoptimize_422016300efb86eb6221204b77eb0035.css so that’s why it’s getting the 404.

    Those files are meant to change every once in awhile so it makes sense why it’s working every once in awhile but something on the page is causing issues with the page looking for a specific css file that doesn’t exist. It might be some sort of issue with caching browser and the files changing fairly quick but it might be worth looking into turning off that css caching so that it will continuing working on the platform.

    • This reply was modified 5 years, 5 months ago by Ashish Jangra.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The only reason why a AO’ed CSS-file would result in a 404 is if said file has been removed from the server due to the AO cache having been purged intentionally (by clearing AO’s cache) or un-intentionally (by having a plugin or theme clear AO’s cache) and the page cache not having been cleared.

    hope this clarifies,
    frank

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi Frank

    It happens when you open the website in incognito mode and load very first time. At that time it returns the error. but when we load it again or refresh the page it works well.

    FYI: We have wpengine and MAX CDN so i think there is some issues with that CDN.

    Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    so do you have CDN active in AO? have you tried disabling it?

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Yes CDN is Active, I have checked alot and understand what cause it could be. As we are enabled CDN. When page load AO combine all css/JS and serve one separate file. So Whenever we load the page at very first time then it creates a file on wordpress directory but all files are serving from CDN.

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    i have disabled CDN and its working proper .. But I am still interested to enable CDN

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you might have to check CDN settings or talk to the CDN provider in that case, it seems they don’t succeed in fetching the optimized CSS/ JS fast enough to be used.

    that being said; because of HTTP/2 and because of the overhead (dns + http + encryption setup) of making a new connection to the CDN-url it can sometimes be better not to put the autoptimized resources on the CDN in the first place.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Return 404 Server failed to load the resources’ is closed to new replies.