简体   繁体   English

为什么Symfony3重定向缓慢

[英]Why Symfony3 redirect slow

Recently I have tried to write a code in Symfony on page redirect (merely simple code for redirect without any other function), run it on localhost. 最近,我尝试在Symfony上的页面重定向上编写代码(仅仅是简单的重定向代码,没有任何其他功能),请在localhost上运行它。 However, the response returned is quite slow somehow (~500ms). 但是,以某种方式返回的响应非常慢(〜500ms)。 What would be the possible cause of this as Laravel page redirect is faster than this. Laravel页面重定向比这快的是什么可能的原因。

When you open the Symfony profiler (just click on the debug toolbar that gets displayed in the bottom of the pages if you are in a development environment) there is a "Last 10" requests button you can click to view profiler information for last couple of requests. 当您打开Symfony探查器时(如果在开发环境中,只需单击显示在页面底部的调试工具栏上的),就会出现“最后10个”请求按钮,您可以单击以查看探查器信息的最后两个要求。

Find your request that returned the redirect response, click on the Token value and you will be able to see in the "Performance" page what is causing the slowdown. 找到返回了重定向响应的请求,单击“令牌”值,您将能够在“性能”页面中查看导致速度下降的原因。

Also, when in development mode some of the changes that you make will require the container to be rebuilt and this can take a while in the development environment with xdebug enabled. 同样,在开发模式下,您进行的某些更改将需要重建容器,而在启用xdebug的开发环境中,这可能需要一些时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM