最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

performance - Disabling ajax code that does a POST request that ends in a 400 error code

programmeradmin3浏览0评论

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 have you tried doing it? This is the kind of thing you should do even if it has no impact on server performance – Tom J Nowell Commented Feb 16, 2022 at 0:51
  • 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
Add a comment  | 

1 Answer 1

Reset to default 0

This 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.

发布评论

评论列表(0)

  1. 暂无评论