Minifying code for PhoneGap App?

后端 未结 5 1326
逝去的感伤
逝去的感伤 2021-02-05 04:08

I am currently starting to build an PhoneGap application, I know the advantages of minifying code for browsers already. However, I was wondering if it was worth minifying my HTM

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 04:23

    An answer from PhoneGap representative, copied from PhoneGap Community Forum :

    "Not necessarily. JavaScript compression is most important for network performance - web applications that are requesting files from remote servers need to wait for the file to be downloaded, so having a smaller file makes the process a lot smoother.

    What matters on mobile devices, and PhoneGap apps specifically, is memory, rather than network traffic. While you may get some memory benefits from running a minified JS file, both the original and the minified file are interpreted into the same code*, so the difference is negligible.

    In most cases, minifying JavaScript is low on the list of priorities for a PhoneGap application."

提交回复
热议问题