pratham.gharat2003@gmail.
New Pleskian
In the default setup, WordPress will any 404 for static file extensions. e.g.
https://example.com/test.css (test.css doesn't exist, so the web server will pass it on to index.php i.e. WordPress).
Many times, due to some plugin like Autoptimize, WP Rocket, etc which change paths for css/js while minifying. When these plugins are disabled without clearing other caches. It leads to a lot of 404 errors which are then handled by WordPress. e.g. 1 Page visit links to 10 different css/js assets which do no exist now. This creates immense load on even websites with moderate traffic. Like in my case the a server with 0.2 (15min) load average spiked up to 2.0 (on a 2 core machine).
This can be easily avoided by not passing files with extensions which are static to WordPress.
For reference: How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html?
I tried to enable nginx handles static files but that didn't work as expected. Can this feature be added? Or at least someone please suggest how to implement this in Plesk. I tried to add the rules in .htaccess but it didn't work. The nginx (static) + apache (dynamic) setup is a bit confusing to grasp (due to missing knowledge) even if we understand what role they play in a setup.
https://example.com/test.css (test.css doesn't exist, so the web server will pass it on to index.php i.e. WordPress).
Many times, due to some plugin like Autoptimize, WP Rocket, etc which change paths for css/js while minifying. When these plugins are disabled without clearing other caches. It leads to a lot of 404 errors which are then handled by WordPress. e.g. 1 Page visit links to 10 different css/js assets which do no exist now. This creates immense load on even websites with moderate traffic. Like in my case the a server with 0.2 (15min) load average spiked up to 2.0 (on a 2 core machine).
This can be easily avoided by not passing files with extensions which are static to WordPress.
For reference: How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html?
I tried to enable nginx handles static files but that didn't work as expected. Can this feature be added? Or at least someone please suggest how to implement this in Plesk. I tried to add the rules in .htaccess but it didn't work. The nginx (static) + apache (dynamic) setup is a bit confusing to grasp (due to missing knowledge) even if we understand what role they play in a setup.