Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

Exploring JavaScript compression


In computer programming, we refer to the process of removing unnecessary characters from the source code files, and eventually concatenating them, as file compression. When dealing with web standards, we can compress any file type, including HTML, CSS, and JavaScript. The main goal of this process is to reduce the file size in order to speed up download time.

One of the benefits of compressing your source code when working with PhoneGap is performance improvement. When dealing with a mobile app, the files are compiled as a single file that eventually loads external data. However, when dealing with an app built using PhoneGap, the files, even if they are stored locally, have to be loaded in the browser (that is, the WebView). Smaller files will be executed faster, so the end user will get a better experience with a more responsive user interface.

You may think that what really matters on a mobile device is the memory consumption, and that compression will not...