I have a javascript snippet that sends a POST request, but the backend no longer serves that request. Would removing that code significantly improve the website performance? The problem is that the ajax code is run on every single page. I am thinking yes, but I am not sure, because unlike a SQL request it doesn't really consume any CPU power.
I have a javascript snippet that sends a POST request, but the backend no longer serves that request. Would removing that code significantly improve the website performance? The problem is that the ajax code is run on every single page. I am thinking yes, but I am not sure, because unlike a SQL request it doesn't really consume any CPU power.
Share Improve this question asked Feb 15, 2022 at 20:14 user214276user214276 2 |1 Answer
Reset to default 0This depends on a lot of factors. The short answer, yes you should remove it as request still needs to be served and this might become problematic at scale. Besides you are slowing down your server without need, and could even block some other request depending on how this was coded.
400
is bad request, please check the response from the server. Maybe it was blocked by security (eg: waf or .htaccess), and or maybe by the codes. – ArrayIterator Commented Feb 16, 2022 at 1:27