-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lot of 404 on generated JS / CSS Files #43
Comments
Hello, You said you did not have this problem with Apache. So my question is: Did this start when you started to use WP-Rocket or if it started when you started to use Rocket-Nginx ? If you don't know, simply disable Rocket-Nginx and see if you still have the problem. Without having the full details, I would say the problem comes from browser cache. The reason could be that the HTML page is cached (with links to CSS and JS). Then, the HTML page is updated with new CSS and JS. But for some reason, when the visitor asks for the page, it uses the old html page (instead of getting the updated one) and tries to get the old CSS and JS... and that's why you have 404. |
I do think you found something interesting and I found a great article about caching. I link it here for future reference: https://kjaer.io/quick-cache-this/. That said, I think you are right and that Rocket-Nginx could be better and not trigger these 404 error. I'll do some testing and try to release a better version ASAP. In the meantime, I encourage you to comment line (with # in front of the line): Then, reload the configuration ( |
Thanks a lot for your answers Maxime, much appreciated :) I'm still investigating on my side, My theory for the moment is this one : 75% of my users are on mobile. But i'm still looking to reproduce the problem and still no luck :P I'm going to try your last suggestion anyway :) (if you need me to provide you log, or conf file i'm using, don't hesitate to ask me !) |
Even with a refresh, the web server should send the right file and not assume it hasn't change. I'm pretty confident the problem was caused by the configuration. Checking my logs, I also have some 404. Not a lot... but it has to be addressed. Thanks again for your time! And let me know if your changes solved the problem. Then, I'll be looking for a fix. |
Ok, the modification is done ! I will let you know asap if there is some changes. |
Hi Maxime, I can't see any ameliorations, i still have a lot of 404 on the .js & .css minified only. Do you have another idea ? Thank you ! |
It might be because the HTML file was cached for a long period. Can you see if you have:
It might take some time to clear the old cached items. Also, if it's the same amount, I will suggest this: remove Rocket-Nginx from your configuration for some time and see what happens. Then, you can reactivate it. Honestly, I did not have time to do much testing on this. Holidays is where I'll have time. |
Ok, Thank you for your fast anwser, it's hard to say cause the traffic is now more important, i will say i have the same amount of errors. I'm going to try to remove Rocket-Nginx in a week and i will let you know if i have somme change. Thanks again, |
Hi, |
Hi Maxime, |
This is totally what I wanted to suggest for now. Then, if it solves the issue, we'll know the lines I told you to comment were problematic. As the cache was for 30 days, you can't expect perfect result for the next 30 days (some old visitors may still have the cached version). Then, I will explore the "cache the page BUT also check with the server if a new version is available". That is faster than simply never caching the page with |
Hi Maxime, |
Thank you very much for your output, I will consider the information you gave me for version 2.0. |
Fixed in 2.0 |
Hi Maxime,
I moved from apache to nginx,
Everything is working fine when i'm browsing the website on my side (and on different devices) everything is correctly loaded but on my error log i have a lot of 404 errors on js and css generated by wp-rocket in the /wp-content/cache/min/1/.
No 404 errors on other files (videos, images).
Thoses 404 errors are generated by other visits. The problem is not for everyone cause 95% of the request on the access log are fine.
I can't figure out where thoses errors come from :(
Can it be the browser cache of the client ? Do you have an idea how i can fix that ? I was having no problem on apache.
Thank you very much !
The text was updated successfully, but these errors were encountered: