Even though drupal.js and are small we have over a 3 Meg savings in bandwidth for just these two files at 10,000 downloads a month. ![]() If you figure you have 10,000 downloads of this bundle of files per month that’s a savings of 420 Megs of bandwidth savings in a month. The savings between gzip compression and gzip plus being minified is 44067 bytes. Well documented files like these can really benefit from being minified. When the file is compressed with gzip all of this text is compressed and shipped. When a file is minified this is stripped out as it’s not needed for functionality. These two files have lots of fantastic documentation in them. ![]() One thing that surprised me right off the bat was that drupal.js and are smaller minified than compressed with gzip. Why Are drupal.js and Smaller When Minified? JavaScript files and their sizes when minified and gzipped. The three files used in the example here were chosen because they are used on ever page in Drupal where JavaScript is used. The table below has a breakdown for discussion. So, here is a case for minifying JavaScript.Ī good place to start is with size examples for different files. Over the past couple weeks I’ve received push back from numerous people who’ve told that me if you use gzip (or deflate) compression there’s no need to minify JavaScript. After all, the major JavaScript packages do it and the performance recommendation tools all recommend it. ![]() This seemed like something simple that I wouldn’t get any push back on. When I was at DrupalCon Denver I suggested that all production JavaScript should be minified.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |