MEAN.JS:慢速充电时间 [英] MEAN.JS: Slow charging time

查看:206
本文介绍了MEAN.JS:慢速充电时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 MEAN.JS 框架(的 MongoDB的前pressJS AngularJS 并的 中的NodeJS)。

I'm using MEAN.JS framework (MongoDB, ExpressJS, AngularJS and NodeJS).

我的捆绑 缩小的咕噜构建所有AngularJS 的.js 文件(控制器,工厂,服务,指令... 的)。

I bundled and minified with grunt build all the AngularJS .js files (Controllers, Factories, Services, Directives...).

结果是2个文件:

css: 'public/dist/application.min.css',
js: 'public/dist/application.min.js'

问题

文件 application.min.js 266KB 的。当用户加载网页,加载页面之前,这个文件需要的5分钟延迟。 (使用 AWS EC2 )。

Problem

The file application.min.js is 266kb. When a user load the web , this file takes 5 minutes delay before the page is loaded . (Using AWS EC2).

GET /dist/application.min.js 200 274.939 ms - -

274939毫秒> 274.939小号> 4.58分钟

274939 ms > 274.939 s > 4.58 min

同样的问题被捆绑和缩小的前发生的事情。我在想,这个问题的解决方案是捆绑和缩小的所有AngularJS文件。但是,是不是。

The same problem was happening before the bundling and minified. I was thinking that the solution of this problem was the bundling and minified of all the AngularJS files. But isn't it.

的.js 文件被加载后,应用程序是非常快的,但需要5分钟来加载中...

After the .js files are loaded, the application is very fast, but takes 5min to loaded...


  • 我需要怎么做才能解决这个问题?我的项目非常大,有很多的文件,据我所知,AngularJS是这样的...
  • 项目
  • What I need to do to solve this problem? My project is large and have a lot of files, and I understand that AngularJS is for projects like this...

推荐答案

我的问题解决了!

最后的问题是不是捆绑和缩小的266KB的文件!

Finally the problem isn't for the bundled and minified 266kb file!

问题是关于 Liveload.js 文件。在本地主机的的 Liveload库的是良好的发展,但不是在生产方式,这种文件需要大量的时间进行充电的页面。

The problem was about the Liveload.js file. In localhost, the Liveload library is good for development, but not in the production mode that this file takes a lot of time for charging the page.

解决方法是删除Liveload依赖。

The solution is remove the Liveload dependence.

这篇关于MEAN.JS:慢速充电时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆