首页 > 解决方案 > 为什么带有灯塔的 chrome 审计中的节点这么慢?

问题描述

我刚刚创建了一个单页js,如下所示:

// Load HTTP module
var http = require("http");

// Create HTTP server and listen on port 8000 for requests
http.createServer(function(request, response) {

   // Set the response HTTP header with HTTP status and Content type
   response.writeHead(200, {'Content-Type': 'text/plain'});

   // Send the response body "Hello World"
   response.end('Hello World\n');
}).listen(57777);

// Print URL for accessing server
console.log('Server running at http://127.0.0.1:57777/');

所以它托管在 localhost:57777 上。这是它的审计结果。

显示审核的图像

我开始学习 express 以提高我的 Angular SSR 性能,但在这里我看到一个带有文本响应的空白项目在性能上是如此糟糕,那么我怎么能期望我的 Angular 应用程序更好。我可以修复性能滞后吗?

或者我应该转向 laravel 或其他 PHP 框架以提高性能,因为我花了很多时间 Angular 并且应用程序仍然不是那么好。

这是我的 Angular Universal 项目的报告,它无法继续部署。

角度统计

有没有办法改进上述我正在遵循这个 Universal Starter 的配置

我也关注了这些博客,但没有任何帮助:

  1. 中型博客
  2. 几乎完全实现了这个清单

标签: node.jsangularperformanceexpresslighthouse

解决方案


基于亨利的评论,我被迫更深入地挖掘,我发现了这种低性能背后的魔鬼。 恶魔

当我运行审计时,我发现我在浏览器上安装的所有扩展也都被考虑在内。

所以解决方案是: 在隐身窗口中运行审计。 现在我将继续优化我的角度。


推荐阅读