简体   繁体   English

如何检查网络应用程序中使用了哪些图像/ css / javascript?

[英]How to check which images/css/javascript are used in web app?

The other day I found this little piece of software - WARI. 前几天,我找到了这个小软件-WARI。 It stands for Web Application REsource Inspector. 它代表Web应用程序资源检查器。 Apparently it checks dependencies between css, html, js and images and reports unused and duplicated css styles, javascript functions and images. 显然,它检查css,html,js和图像之间的依赖关系,并报告未使用和重复的css样式,javascript函数和图像。

Link: WARI is released! 链接: WARI已发布!

What do you use? 你用什么? Any alternatives? 有其他选择吗?

Conceptually such a tool would be very handy as it is typically a very awkward task to find stray files and safely remove them. 从概念上讲,这种工具非常方便,因为查找杂散文件并安全地删除它们通常是一项非常尴尬的任务。

I'm not sure if this is the case... but from the wording of this question it looks like this might be a self-promotion question which isn't an endorsed activity. 我不确定是否是这样...但是从这个问题的措辞看来,这可能是一个自我推广的问题,而不是认可的活动。 If you wanted to follow up to the generic question "what tools are out there to do x,y, & z" with your own answer that would be fine. 如果您想用自己的答案回答通用问题“那里有什么工具可以进行x,y和z”,那就很好了。

For the record, I use 2 tools called CheckWeb and Xenu that will follow all links and report back what was found. 作为记录,我使用2个名为CheckWeb和Xenu的工具,这些工具将跟踪所有链接并报告发现的内容。

This finds me any 404's, and I then compare the list of referenced files against my directory listing to see what files were not used. 这样可以找到404,然后将参考文件列表与目录列表进行比较,以查看未使用哪些文件。 (Its rough, but works) (虽然粗糙,但是有效)

As Stat1124 has mentioned Firebug is invaluable. 正如Stat1124提到的,Firebug是无价的。 The net panel is great for this purpose as it shows the time required to load all the assets associated with a page - and if a resource is unavailable it also shows the HTTP response code. 网络面板非常适合此用途,因为它显示了加载与页面关联的所有资产所需的时间-如果资源不可用,它还会显示HTTP响应代码。

When trying to optimise a site, yslow ( http://developer.yahoo.com/yslow/ ) is a great addition to firebug - as it provides specific implementation tips to achieve a more responsive page load. 尝试优化网站时,yslow( http://developer.yahoo.com/yslow/ )是Firebug的重要补充-因为它提供了具体的实现技巧来实现更快速的页面加载。

There's also a great utility called smush.it ( http://developer.yahoo.com/yslow/smushit/ ) - which has recently been added to the yslow tool-kit - which produces optimisations to reduce image size. 还有一个很棒的实用程序,名为smush.it( http://developer.yahoo.com/yslow/smushit/ )-最近已添加到yslow工具箱中-可以进行优化以减小图像尺寸。

You can try Google´s page speed 您可以尝试Google的页面速度

With that you can check all relevant things about your website. 这样您就可以检查有关您网站的所有相关信息。 Which CSS are unused, Google page speed minifies your JS files and so on. 哪些CSS未使用,Google页面速​​度会最小化您的JS文件,依此类推。 Check it out, you will be impressed. 检查一下,您会印象深刻。 :-) :-)

If you are a Firefox fan, I happen to use Firebug add-on that serves a jack of all trades web development kit. 如果您是Firefox爱好者,那么我碰巧会使用Firebug附加组件,该附加组件可用于所有行业的Web开发工具包。 I might exaggerate a little bit however I find it very useful. 我可能会夸大一点,但是我发现它非常有用。 Here is a quick blurb: Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. 快速介绍一下:Firebug与Firefox集成在一起,可在您浏览时将大量Web开发工具置于您的指尖。 You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page 您可以在任何网页中实时编辑,调试和监视CSS,HTML和JavaScript

If you want to know more info, you can check out their homepage here: Firebug 如果您想了解更多信息,可以在这里查看其主页: Firebug

If your goal is to speed up your page-loading time, WARI seems like it would certainly help you reduce the data required to load your page. 如果您的目标是加快页面加载时间,那么WARI似乎肯定会帮助您减少加载页面所需的数据。

However, I suggest that you go a step further -- take Yahoo!'s advice and minimize the number of HTTP requests : 但是,我建议您更进一步-采纳Yahoo!的建议,尽量减少HTTP请求的数量

  • Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. 组合文件是一种通过将所有脚本组合为一个脚本,并类似地将所有CSS组合为一个样式表来减少HTTP请求数量的方法。 Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times. 当脚本和样式表在页面之间变化时,合并文件更具挑战性,但是将其作为发布过程的一部分可以缩短响应时间。
  • CSS Sprites are the preferred method for reducing the number of image requests. CSS Sprites是减少图像请求数量的首选方法。 Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment. 将您的背景图像合并为一个图像,并使用CSS background-image和background-position属性显示所需的图像段。
  • Inline images use the data: URL scheme to embed the image data in the actual page. 嵌入式图像使用data: URL方案将图像数据嵌入到实际页面中。 This can increase the size of your HTML document. 这会增加HTML文档的大小。 Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages. 将嵌入式图像组合到您的(缓存的)样式表中是减少HTTP请求并避免增加页面大小的一种方法。 Inline images are not yet supported across all major browsers. 并非所有主流浏览器都支持嵌入式图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查CSS,JavaScript和图片没有立即过期 - How can I check that css, javascript and images are not expiring straight away 如何在spring-mvc Web应用程序中放置图像/ CSS? - How to place images/CSS in spring-mvc web app? 如何检查在接口列表上使用的实现 - How to check which implementation is used on a List of an Interface 登录我的Java Web应用程序时,我被定向到登录表单使用的CSS,如何解决这个问题? - When logging into my Java web app, I'm directed to the CSS used by the login form, how to fix this? 可以使用哪个Tomcat Mbean访问Web应用程序信息 - Which Tomcat Mbean can be used to access web app information 在显示主要内容之前,如何抓取运行带有JavaScript的Javascript的网页 - How to crawl web page which run Javascript with cookies check before showing main content 在 jsp/java ee web 应用程序中加载图像/css/javascript - Loading images/css/javascript in a jsp/java ee web application 如何检查android应用中的图像是否最新? - How to check if images in an android app are current? 如何检查哪些类作用于应用程序功能? - How to check which classes act on an app feature? Maven:如何检查哪些罐子根本没用 - Maven:how to check which jars are not being used at all
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM