SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 232 | Next

Richard Wagner

"Professional iPhone and iPod touch Programming: Building Applications for Mobile Safari"

2em Helvetica, Arial, sans-serif};
Consider using shorter CSS style names and JavaScript variable and function names. After all,
the longer your identifiers are, the more space your files will take. But, at the same time, do not
make your identifiers so short that they become hard to work with. For example, consider the
trade - offs with the following three declarations:
/* Inefficient */
#homepage-blog-subtitle-alternate-version{letter-spacing:.1em;}
/* Efficient, but cryptic */
#hbsa{letter-spacing:.1em;}
/* Happy medium */
#blog-subtitle-alt{letter-spacing:.1em;}
As you work through these various strategies and test results, a good way to check the total page size is
to save the page as a Web archive in a desktop version of Safari. The file size of the archive file indicates
the HTML page size with all of the external resources (images, style sheets, and script libraries)
associated with it.
Compressing Your Application
Normally, an iPhone/iPod touch Web application will be launched when a user types the URL in their
Mobile Safari browser. The Web server will respond to the HTTP request and serve the HTML file and
each of the many supporting files that are used in the display and execution of the Web app. While
image files may have been optimized as much as possible to minimize bandwidth, each uncompressed
HTML file, CSS style sheet, and JavaScript library file requested will always take up much more space
??‘
??‘
??‘
??‘
??‘
??‘
Chapter 9: Bandwidth and Performance Optimizations
212
than if it were compressed.


Pages:
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244