angular.js - AngularJS制作的网页怎么提高访问速度?
滿天的星座
滿天的星座 2017-05-15 16:56:04
0
6
575
  1. AngularJS在访问的时候要加载诸多的js文件,如果手机网速不快,那么可能要加载好久。
  2. 提高后台的响应速度,不知为何100Mps的阿里云,我用python的flask写后台api,有时候一个请求要十几秒。。。
  3. 其他可以提高访问速度,节省用户流量的方式

以上几点,本人菜鸟,只是略微有些了解,比如不要第一次加载所有js文件等等,希望有高手能给出一点更具体的实施的措施,十分感谢!

滿天的星座
滿天的星座

reply all(6)
为情所困

1. Compress all JS file dependencies that need to be used.
2. Loading on demand means loading which JS files you need to depend on.
3. Use a CDN.

洪涛

Data caching, compression and merging code

Compared to react, angular is really slow to load for the first time. There is no way, react can decide when to load based on the life cycle.

伊谢尔伦

The main ones are
1. Asynchronous loading
2. Loading on demand
3. Data caching (local caching of static resources that are not frequently updated, ajax request caching)
4. Adding loading to improve user experience
5.CND
6. Compression merge.
If the client wants to accelerate, it should focus on file size, request time, code execution efficiency, and mobile terminals should also pay attention to issues such as using canvas for hardware acceleration of images, css layout, etc., which will also affect efficiency, page rendering, etc.

黄舟

For the first time js is loaded, it will be loaded synchronously. If it is not required for the homepage, it can be loaded asynchronously

小葫芦

Compress and merge js and css into two files, apply for a free oss on Alibaba, and upload the files.

滿天的星座

Click f12 on Chrome or ff to see the entire loading process
1. How many files are loaded, how many static and how many dynamic? 2. Are there any special abnormalities in each static loading step and each dynamic step? 3. Consider dns resolution and cache usage , whether there are any abnormalities in the delay from request to response, the transmission process, and the large inactivity time during the loading process
In addition, whether the line between your network and the server is stable

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!