HTML + JavaScript + CSS紧凑工具 [英] HTML + JavaScript + CSS compact tool

查看:222
本文介绍了HTML + JavaScript + CSS紧凑工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




  • 我们需要一个可以缩小,优化和处理这些可能类型的文件的工具
  • >
  • JavaScript(minify,optimize and munge)

  • CSS(minify)


$ b b

最终结果应该是一个HTML文件,只包含嵌入的所有JavaScript和CSS,或者最差的情况是分别为HTML,JS和CSS的3个文件。



我知道像YUI Compressor等工具。我目前没有找到的压缩机类型将工作在所有这些文件类型,并将它们合并在一个巨大的文件只有。

解决方案

Gad,考虑缩小CSS的缺点。如果你没有一个系统,你编辑正常/ minify /然后部署它可以使以后编辑CSS而不是骰子。



我在一个国际银行的大UI刷新项目上经历了这个整个论点。一个网站特别是做了100万+访问者/天,带宽数字是疯了,尽管我们的努力保持最小(每个小点加在一个大量贩运的网站)。一个有很多才华的大团队的业务分析,它是确定我们将采取几个步骤,但没有css缩小,由于增加的时间,它需要工程师撤消缩小固定,缩小和重新部署简单的CSS调整之前。数据显示,即使带宽提高了5gb /天,在额外的时间内不支付UI工程师的费用仍然较低。



我们不知道您的网站具体细节,但没有太多的,我们的例子使用的流量担心。运行你的网站在Firebug的新速度分析仪,看看什么真正的好处是可以缩小.....现在乘以你的流量。通常,这个数字不太可怕。花费你的时间做图像精灵,结合css和js到各自的文件(比混合到单个php文件由于缓存的好处)限制http请求,并确保缓存正确设置。运行gzip压缩。如果在那些步骤后你不好,那么把网站带到一个新的水平。



保持简单....它在更新和维护部分的网站的生命周期。随着时间和头痛得以保存,您可以帮助我们解决我们的问题:)


I need a tool which can minify, optimize and munge many files of those possible types

  • HTML (minify only)
  • JavaScript (minify, optimize and munge)
  • CSS (minify)

The final result should be one HTML file only with all JavaScript and CSS embedded or in the worst scenario 3 files respectively for HTML, JS, and CSS.

I am aware of tools like YUI Compressor etc. What I currently have not found is the type of compressor which will work on all those file types and merge them in one huge file only.

解决方案

Gad, consider the drawbacks to minifying CSS. If you don't have a system where you edit normal/minify/ then deploy it can make later editing of CSS rather dicey.

I went through this whole argument on a big UI refresh project for an international bank. One site in particular was doing 1million+ visitors/day and bandwidth numbers were insane despite all our efforts to keep it minimal (every little bit adds up on a site that heavily trafficked) Upon business analysis by a large team of very talented minds, it was determined that we would take several steps, but NOT css minifying due to the added time it would take engineers to undo the minifying before fixing, minifying and redeploying for simple CSS tweaks. The numbers showed that even with a 5gb/day bandwidth improvement, it was still cheaper to not pay a UI engineer for the extra time.

We don't know your site's specifics, but there aren't terribly many that have to worry about the traffic my example uses. Run your site in Firebug's new speed analyzer and see what the real benefit could be from minifying.....now multiply that by your traffic. Usually, that number isn't too scary. Spend your time doing image sprites, combining css and js into respective files (better than mashing into individual php files due to caching benefits) to limit http requests, and ensuring that caching is properly setup. Run gzip compression. If after those steps you're not good, then take the site to a new level.

Keep it simple....it makes a huge difference in the update and maintenance portions of the site's lifecycle. With the time and headache saved, you can help us out with our questions :)

这篇关于HTML + JavaScript + CSS紧凑工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆