【问题标题】:Equivalent of "Google Closure Compiler" for HTML?相当于 HTML 的“Google Closure Compiler”?
【发布时间】:2009-11-07 16:34:30
【问题描述】:

是否有与 Google 的 Closure Compiler 等效的用于 HTML 最小化的方法?

【问题讨论】:

    标签: html minify google-closure google-closure-compiler


    【解决方案1】:

    我猜你的意思是 Closure 编译器,它可以有效地压缩 javascript。如果您在the goog 中搜索“HTML Compressor”,您会发现有很多适合个人需求的选项。

    【讨论】:

      【解决方案2】:

      考虑 HTML 整洁:

      http://infohound.net/tidy/

      这是一款出色的免费工具。

      【讨论】:

        【解决方案3】:

        我觉得你可以试试google的mod_pagespeed,它会缩小响应内容。

        【讨论】:

          【解决方案4】:

          我编写了一个 python 脚本,替换 pushlish 中的所有 id 和类名。该脚本为每个类名和 id 生成唯一的令牌,并在 javascript、css 和 html 模板文件中替换。它对我很有用

          【讨论】:

            【解决方案5】:

            我正在使用Minify 在运行时修剪和压缩 html。唯一的要求和设置是您将Minify 放在您的服务器上,并将以下代码添加到页面中。

            <?php require $_SERVER['DOCUMENT_ROOT'] . '/min/pageBuffer.php'; ?>
            <!-- html -->
            

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2014-10-15
              • 2011-05-12
              • 2017-10-04
              • 2019-09-27
              • 2016-08-15
              • 1970-01-01
              相关资源
              最近更新 更多