memTronic

http://hometown.aol.de/_ht_a/memtronic/

MemTronic's FREEWARE HTML/JavaScript Cruncher-Compressor
General Notes:
=============
  • NEW in v1.0 [Jul-2006]:
    - Improved the whole compressor-part again which results in even smaller output than with 0.9g!
    - Additionally the compression of bigger files (over 15 KBytes crunched) is faster than ever before!
    - DeCompression-Routine rewritten from scratch so that users with other than ISO-8859-1 charsets
      no longer should encounter any problems when using their language specific charsets!
    - Additionally decompression is a lot faster than with 0.9g in all available browsers!
    - Cruncher partly rewritten so that it should no longer cause trouble with some regular expressions!
    - Additionally crunching is a little bit faster and memory-consumption in Firefox is reduced too.
    - Fixed wrong size-reporting in Firefox which only counts carriage-returns and no line-feeds!
    - After over 2 years the former version being online it felt necessary to change the overall look too...
  • COMPRESSOR itself was tested successfully under: IE 6.0+ / Firefox 1.5.0.4 / Opera 7.22
  • CRUNCHER also crunches pure CSS files since v0.5. It seems that only a few people found that out!
  • CRUNCHED output should work in all available Browsers. (as long as the original Input worked!)
  • COMPRESSED output was tested successfully under: IE 5+ / NS 7.0 / Mozilla / Opera 7.0
  • LATEST Version available at: MemTronic's Place. For BUG-Reports or Feedback mail to: PurpleBytes
  • Here is one of my Test-Results (a real world web-application) which represents the progress:
    ==============================================================================
    CPU: Athlon XP 2,8 GHz

    Browsers:
    IE  = Internet Explorer 6.0.2900.2180.xpsp2_gdr.050301-1519
    FF = Firefox 1.5.0.4

    File size.......: 193.858 Bytes
    Crunched.....: 113.148 Bytes
    Compression: Normal

    v0.9g
    Compressed: 44.129 Bytes
    Ratio...........: 77.24%
    Time IE........: 44:51 Minutes
    Time FF.......: You don't want to compress this file in Firefox with v0.9g... believe me!
                        (Several hundred times clicking "continue" isn't that fun!!!)

    v1.0k
    Compressed: 24.964 Bytes
    Ratio...........: 87.12%
    Time IE........: 1:39 Minutes
    Time FF.......: 3:41 Minutes

    This is what I call improvement... hehe

What it is good for:
================
  • The HTML/JavaScript Cruncher (also known as squeezing):
    Removes whitespace and comments in all JavaScript-Blocks,Style-Sheet-Blocks, HTML-Blocks.
    This results in Bandwidth-Savings between 20% - 50%. (Depends on use of comments and style)
    The entire file will work like any uncrunched file. (Search-Engines and users still can parse the code)
  • The HTML/JavaScript Compressor:
    Compresses the entire file with a real compression-scheme! (Auto-DeCompression added to file)
    (detects: pure JavaScript, pure HTML/CSS or HTML/CSS mixed with JavaScript).
    This results in Bandwidth-Savings between 40% - 90%. (I still keep this statement)
    Besides the META-Tags (which are always kept untouched) the file is no longer parseable by any Search-Engine or user! (Compressing .js files is always a good idea!)
  • The HTML/JavaScript Obfuscator (not in this release):
    Obfuscates (scrambles) all JavaScript-Code so that it is no longer easily readable by human beings.
    This results in additionally reduced size (short replace) or absolutely hard to read code (long replace)
    The entire file will work like any unobfuscated file.
    (Search-Engines still can parse the HTML-code but no one can simply steal your JS-Code!)

Known Issues:
=============
  • Compression can take a lot of time for Input bigger than 15 KByte with "Hardcore"-Switch set.
  • JavaScript not ending with semicola [;] => Will be corrupted!
    (Stay Standard => Use semicola and everything should be fine)
  • META-Tags behind the HEAD-Tag (NON-Standard!) => Cause trouble!
  • Avoid the following in Strings:
    '<script' | '</script>' | '<body' | '</body>'
    split it up like: '<'+'script' or encode it like: '\x3cscript'
  • Avoid the following in multi-line comments:
    /* xyz = '*/' */ or similar constructs.
    split it up like: /* xyz = '*'+'/' */ or encode it like: '\x2a/'
  • Browser specific problems:
    - Firefox 1.0: Output gets truncated to 62500 Bytes.
    - Opera 9.0: Every 65537th Byte gets replaced by a carriage-return and line-feed.


posted @ 2007-07-30 11:05 Robot·H 阅读(113) 评论(2)  编辑 收藏 网摘 所属分类: CSS+Javacript

  回复  引用    
#1楼 2007-11-27 10:43 | jake0001 [未注册用户]
您好,最近也在研究js压缩,想试一下MemTronic,
写了一个很简单的测试,让他压缩
我的js如下 test.js
alert('hello')
var a = 0
a=a+1
a=a+1
a=a+1
a=a+1
a=a+1
a=a+1
....
一直加到,他要求的最小文件2k
但是,结果压出来的js为何一直报错呢
  回复  引用    
#2楼 2008-01-30 14:33 | tigeraaaa [未注册用户]
汗!!所有statement 后要加;


标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
开发者征途系统新作:《设计模式——基于C#的工程化实现及扩展》



相关文章:

相关链接: