TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Compression of JavaScript programs

23 pointsby DanielHabout 14 years ago

3 comments

dexenabout 14 years ago
A document [1] by Ray Cromwell introduces an aid for JS compression, both theory and implementation [2]. The idea is to transform JS code before compression in a way that, while keeping JS semantics, makes is best possible candidate for the popular gzip deflate compression.<p>----<p>[1] <a href="http://timepedia.blogspot.com/2009/08/on-reducing-size-of-compressed.html" rel="nofollow">http://timepedia.blogspot.com/2009/08/on-reducing-size-of-co...</a><p>[2] <a href="http://code.google.com/p/google-web-toolkit/source/detail?r=5972" rel="nofollow">http://code.google.com/p/google-web-toolkit/source/detail?r=...</a>
评论 #2493017 未加载
willvarfarabout 14 years ago
<i>cough</i> your server could serve gzipped stream and the browser would transparently uncompress it.<p>Sure there are browsers that can't decompress these streams, but your webserver already knows when to send the full (but minified) JS instead. Its all handled automatically.
评论 #2492510 未加载
评论 #2493028 未加载
verisimilitudeabout 14 years ago
This is a great process to maximize your JS compression. However, it's important to keep in mind the application. From the jQuery dl page (yes, they use a different compression method):<p>"The packed versions require non-trivial client-side processing time to uncompress (unpack) the code whereas the minified versions do not."