Like CSS, JavaScript works best and hardest when stored in an external file that can be downloaded and cached separately from our site's individual HTML pages. To increase performance, we limit the number of external requests and make our JavaScript as small as possible. JavaScript minification schemes began with JSMin in 2004 and progressed to the YUI Compressor in 2007. Now the inventor of Extreme JavaScript Compression with YUI Compressor reveals coding patterns that interfere with compression, and techniques to modify or avoid these coding patterns so as to improve the YUI Compressor's performance. Think small and live large.
展开▼