search

Home  >  Q&A  >  body text

angular.js - How to improve the access speed of web pages made with AngularJS?

  1. AngularJS needs to load many js files when accessing. If the mobile phone network speed is not fast, it may take a long time to load.
  2. Improve the response speed of the background. I don’t know why Alibaba Cloud has 100Mps. I use python’s flask to write the background API. Sometimes a request takes more than ten seconds. . .
  3. Other ways to improve access speed and save user traffic

I am a novice on the above points, and I only have a little understanding of them. For example, do not load all js files for the first time, etc. I hope that some experts can give some more specific implementation measures. Thank you very much!

滿天的星座滿天的星座2793 days ago659

reply all(6)I'll reply

  • 为情所困

    为情所困2017-05-15 16:58:04

    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.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 16:58:04

    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.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 16:58:04

    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.

    reply
    0
  • 黄舟

    黄舟2017-05-15 16:58:04

    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

    reply
    0
  • 高洛峰

    高洛峰2017-05-15 16:58:04

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

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-15 16:58:04

    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

    reply
    0
  • Cancelreply