What techniques can I use to make JS-heavy pages performant on mobile devices?

前端 未结 3 553
渐次进展
渐次进展 2021-02-09 12:30

I have a site that involves a large amount of JS code (~100K including jQuery). When I browse similar sites on my phone or tablet, I\'m usually disappointed at how sluggish they

3条回答
  •  既然无缘
    2021-02-09 12:37

    You are not really going to be able to find optimizations that are specific only to mobile devices. The two that you mentioned, disabling animations and intensive CSS effects, will just as well work to increase responsiveness on a slow desktop PC. Similarly, any other optimization you can make to target a mobile device will also improve performance on a desktop PC.

    With that said, the only semi-optimization I can think of that greatly benefits mobile devices in particular is to reduce your page's physical size. This is so that people don't have to waste time zooming to different parts of your page.

    Also, to add to your list, I highly recommend using Minify: http://code.google.com/p/minify/

提交回复
热议问题