随机 - 大约50%的页面加载 - 我在加载页面时看到大约5秒的延迟。这些延迟总是在完全不涉及PHP的Javascript或CSS文件上。当我查看开发人员工具中从服务器发送的内容时,我会看到Tracy Debug Bar的标记,然后是预期的标头,然后是一些编码的二进制垃圾。例如,这是我的浏览器请求“app.js”
的结果<!-- Tracy Debug Bar -->
<script src="?_tracy_bar=js&v=2.5.0&XDEBUG_SESSION_STOP=1" data-id="121f475336"></script>
<script>
Tracy.Debug.init("\t\t<div class=\"tracy-panel \" id=\"tracy-debug-panel-Tracy-info\" data-tracy-content=\"<style class="tracy-debug">\n\t#tracy-debug .tracy-InfoPanel td {\n\t\twhite-space: nowrap;\n\t}\n\t#tracy-debug .tracy-InfoPanel td:nth-child(2) {\n\t\tfont-weight: bold;\n\t\twidth: 30%;\n\t}\n\t#tracy-debug .tracy-InfoPanel td[colspan='2'] b {\n\t\tfloat: right;\n\t\tmargin-left: 2em;\n\t}\n<\/style>\n\n<h1>System info<\/h1>\n\n<div class="tracy-inner tracy-InfoPanel">\n<div class="tracy-inner-container">\n<table>\n<tr>\n\t<td>Execution time<\/td><td>26.1\u202fms<\/td>\n<\/tr>\n<tr>\n\t<td>CPU usage user + system<\/td><td>46\u202f% + 0\u202f%<\/td>\n<\/tr>\n<tr>\n\t<td>Peak of allocated memory<\/td><td>1.09\u202fMB<\/td>\n<\/tr>\n<tr>\n\t<td>Included files<\/td><td>52<\/td>\n<\/tr>\n<tr>\n\t<td>OPcache<\/td><td>100% cached<\/td>\n<\/tr>\n<tr>\n\t<td>Classes + interfaces + traits<\/td><td>27 + 2 + 1<\/td>\n<\/tr>\n<tr>\n\t<td>Your IP<\/td><td>142.244.29.20<\/td>\n<\/tr>\n<tr>\n\t<td>Server IP<\/td><td>142.244.26.53<\/td>\n<\/tr>\n<tr>\n\t<td>HTTP method \/ response code<\/td><td>GET \/ 200<\/td>\n<\/tr>\n<tr>\n\t<td>PHP<\/td><td>7.0.27-0+deb9u1<\/td>\n<\/tr>\n<tr>\n\t<td>Tracy<\/td><td>2.5.0<\/td>\n<\/tr>\n<tr>\n\t<td>Server<\/td><td>Apache\/2.4.25 (Debian)<\/td>\n<\/tr>\n<\/table>\n\n\t<h2><a class="tracy-toggle tracy-collapsed" data-tracy-ref="^div .tracy-InfoPanel-packages">Composer Packages (17)<\/a><\/h2>\n\n\t<div class="tracy-InfoPanel-packages tracy-collapsed">\n\t\t<table>\n\t\t\t<tr><td>doctrine\/lexer<\/td><td>v1.0.1<\/td><\/tr>\n\t\t\t<tr><td>dragonmantank\/cron-expression<\/td><td>v2.1.0<\/td><\/tr>\n\t\t\t<tr><td>egulias\/email-validator<\/td><td>2.1.3<\/td><\/tr>\n\t\t\t<tr><td>firebase\/php-jwt<\/td><td>v5.0.0<\/td><\/tr>\n\t\t\t<tr><td>google\/apiclient<\/td><td>v2.2.1<\/td><\/tr>\n\t\t\t<tr><td>google\/apiclient-services<\/td><td>v0.55<\/td><\/tr>\n\t\t\t<tr><td>google\/auth<\/td><td>v1.3.0<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/guzzle<\/td><td>6.3.2<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/promises<\/td><td>v1.3.1<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/psr7<\/td><td>1.4.2<\/td><\/tr>\n\t\t\t<tr><td>monolog\/monolog<\/td><td>1.23.0<\/td><\/tr>\n\t\t\t<tr><td>phpseclib\/phpseclib<\/td><td>2.0.11<\/td><\/tr>\n\t\t\t<tr><td>psr\/cache<\/td><td>1.0.1<\/td><\/tr>\n\t\t\t<tr><td>psr\/http-message<\/td><td>1.0.1<\/td><\/tr>\n\t\t\t<tr><td>psr\/log<\/td><td>1.0.2<\/td><\/tr>\n\t\t\t<tr><td>swiftmailer\/swiftmailer<\/td><td>v6.0.2<\/td><\/tr>\n\t\t\t<tr><td>tecnickcom\/tcpdf<\/td><td>6.2.17<\/td><\/tr>\n\t\t<\/table>\n\t\n\t\t<\/div>\n<\/div>\n<\/div>\n\n\n\t<div class="tracy-icons">\n\t\t<a href="#" rel="window" title="open in window">&curren;<\/a>\n\t\t<a href="#" rel="close" title="close window">&times;<\/a>\n\t<\/div>\n\"><\/div>\t\t<div class=\"tracy-panel \" id=\"tracy-debug-panel-Tracy-errors\" data-tracy-content=\"\"><\/div>\n<div id=\"tracy-debug-bar\">\n\t<ul>\n\t\t<li id=\"tracy-debug-logo\" title=\"Tracy Debugger 2.5.0 \nhttps:\/\/tracy.nette.org\">\n\t\t\t<svg viewBox=\"0 -10 1561 333\"><path fill=\"#585755\" d=\"m176 327h-57v-269h-119v-57h291v57h-115v269zm208-191h114c50 0 47-78 0-78h-114v78zm106-135c17 0 33 2 46 7 75 30 75 144 1 175-13 6-29 8-47 8h-27l132 74v68l-211-128v122h-57v-326h163zm300 57c-5 0-9 3-11 9l-56 156h135l-55-155c-2-7-6-10-13-10zm-86 222l-17 47h-61l102-285c20-56 107-56 126 0l102 285h-61l-17-47h-174zm410 47c-98 0-148-55-148-163v-2c0-107 50-161 149-161h118v57h-133c-26 0-45 8-58 25-12 17-19 44-19 81 0 71 26 106 77 106h133v57h-119zm270-145l-121-181h68l81 130 81-130h68l-121 178v148h-56v-145z\"\/><\/svg>\n\t\t<\/li>\n\t\t\t\t<li><a href=\"#\" rel=\"tracy-debug-panel-Tracy-info\"><span title=\"Execution time\">\n<svg viewBox=\"0 0 2048 2048\"><path fill=\"#86bbf0\" d=\"m640 1153.6v639.3h-256v-639.3z\"\/><path fill=\"#6ba9e6\" d=\"m1024 254.68v1538.2h-256v-1538.2z\"\/><path fill=\"#4f96dc\" d=\"m1408 897.57v894.3h-256v-894.3z\"\/><path fill=\"#3987d4\" d=\"m1792 513.08v1279.8h-256v-1279.8z\"\/>\n<\/svg><span class=\"tracy-label\">26.1\u202fms<\/span>\n<\/span><\/a><\/li>\t\t<li><a href=\"#\" rel=\"close\" title=\"close debug bar\">×<\/a><\/li>\n\t<\/ul>\n\n<\/div>", []);
</script>
HTTP/1.1 200 OK
Date: Wed, 06 Jun 2018 21:46:08 GMT
Server: Apache/2.4.25 (Debian)
Last-Modified: Tue, 15 May 2018 19:33:41 GMT
ETag: "13eb-56c43adfabcb7-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 2232
Keep-Alive: timeout=5, max=97
Connection: Keep-Alive
Content-Type: application/javascript
[binary type characters I assume is my browser attempting to display the gzipped contents of app.js]
看起来由于某种原因,随机请求让Tracy在实际内容之前注入了自己。
我不是百分百肯定这是特雷西问题,但我不知道它还能是什么。这不会发生在每个页面加载 - 因此它不是服务器配置或无效的URL。它并不总是发生在同一个文件中 - 但它始终存在于Javascript或CSS文件中,根本不应该涉及Tracy。我也在Firefox和Chrome中看到了这一点,因此对于一个特定的浏览器来说这不是问题。