AJAX请求的时间比正常请求长

时间:2022-10-13 15:57:10

Morning all,

We're building an Angular app and we're stumped by a particular problem whilst trying to speed the thing up. I've attached two photos, one is of an AJAX request made from within a larger page.

我们正在构建一个Angular应用程序,我们在尝试加快速度的同时遇到了一个特定的问题。我附上了两张照片,其中一张是在较大页面内制作的AJAX请求。

AJAX请求的时间比正常请求长

And this one is of the same request, same parameters, etc, made only a few seconds after (and it's not cache issue).

而且这个请求,相同的参数等只是在几秒钟之后发出(并且它不是缓存问题)。

AJAX请求的时间比正常请求长

The environment is:

环境是:

  • IIS
  • PHP5.4
  • Memcache currently disabled
  • Memcache目前已禁用

1 个解决方案

#1


0  

What exactly is your question? Angular does not make HTTP requests - it just wraps XMLHttpRequest into a convenient form for you. It has no control over how long the request takes to complete once it is started, and factors like IIS and Memcache are irrelevant to it.

你的问题究竟是什么? Angular不会发出HTTP请求 - 它只是将XMLHttpRequest包装成一个方便的形式。它无法控制请求在启动后完成所需的时间,IIS和Memcache等因素与它无关。

You need to discuss what you're doing in your PHP code on the server and re-tag the question with appropriate markers for the communities (like PHP developers) who help out in those areas.

您需要在服务器上讨论您在PHP代码中所做的事情,并使用适当的标记重新标记问题,以帮助这些领域的社区(如PHP开发人员)。

#1


0  

What exactly is your question? Angular does not make HTTP requests - it just wraps XMLHttpRequest into a convenient form for you. It has no control over how long the request takes to complete once it is started, and factors like IIS and Memcache are irrelevant to it.

你的问题究竟是什么? Angular不会发出HTTP请求 - 它只是将XMLHttpRequest包装成一个方便的形式。它无法控制请求在启动后完成所需的时间,IIS和Memcache等因素与它无关。

You need to discuss what you're doing in your PHP code on the server and re-tag the question with appropriate markers for the communities (like PHP developers) who help out in those areas.

您需要在服务器上讨论您在PHP代码中所做的事情,并使用适当的标记重新标记问题,以帮助这些领域的社区(如PHP开发人员)。