search

Home  >  Q&A  >  body text

javascript - The page loads slowly, what are the optimization solutions?

Can anyone help me find out why the page loads so slowly? I hope you can analyze it in detail and find any good solutions.
Online address http://cqwind.chinacloudapp.c...

学习ing学习ing2704 days ago978

reply all(4)I'll reply

  • 迷茫

    迷茫2017-07-05 11:06:00

    Looking at the picture, the ones that take the longest are Ajax/XHR requests.

    Since static resources load very quickly, it cannot be due to network speed. So you can:

    1. Try to merge HTTP requests on the front end.

    2. Let the background be optimized to improve the response speed. (Looking at your situation, the most critical place should be here; if the backend is blaming you, then you can simulate HTTP requests elsewhere, such as using tools like Postman, and let the facts speak for themselves.)

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-07-05 11:06:00

    1. Compress js and css, even if I look at them, they are not compressed at all

    2. Compress pictures

    3. You can package the css, or it is recommended to make a loading layer when loading for the first time

    It is best to compress and package these resource files, which can be easily achieved with gulp. If you want to provide a better user experience, you can learn from Google
    earth. Load all resources and bundles on the first visit and provide a loading layer. The subsequent dynamic data must either be rotated or directly used as websocket

    Also, I looked carefully and found that the call to your data is quite time-consuming, so it is recommended that you still have to do some back-end optimization. Google also has a health check tool that will provide you with suggestions

    reply
    0
  • PHP中文网

    PHP中文网2017-07-05 11:06:00

    1. Check the client and server networks, 40 seconds is generally not normal;

    2. Chrome -> F12 -> Audits Carefully read the suggestions he gave;

    3. png Convert all to webP, at least use tinyPNG;

    4. Find out the static resources that hinder loading and go to CDN;

    5. Upgrade http/2;

    6. Preloading / local cache;

    7. If it is not JSP, replace Tomcat, such as nginx;

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-07-05 11:06:00

    1. The time-consuming calculation part can be left to the background for regular processing, the results are cached, and the page can directly call the cache

    2. Optimize calculation logic

    3. Detection time sql

    reply
    0
  • Cancelreply