我的网站很高兴Gzipped根据:
http://www.gidnetwork.com/tools/gzip-test.php
但是,当我通过Yslow运行它时,我得到一个G for Gzip,它将我的所有脚本列为未压缩的组件.
有任何想法吗 ?
在我的网站上,我有以下代码:
<input type="image" src="images/btn.png" alt="Submit" border="0" height="25" width="102" />
Run Code Online (Sandbox Code Playgroud)
当我通过众多HTML验证器中的一个运行我的网站时,他们会提示通知我:
是INPUT元素的无效属性.
但是,YSlow和Google PageSpeed告诉我,我应该始终包含图像尺寸,以提高解析HTML的速度.
还有什么其他方法可以使用图像提交按钮,同时仍然是HTML有效并遵循YSlow建议?
我希望改善我的应用程序的前端性能,所以我在Firefox中使用了YSlow工具.当我为我的应用程序运行此工具时,在YSlow等级选项卡中,它出现了"使用gzip压缩组件F级"的问题.似乎是我们需要在从服务器发送到客户端时压缩文件(js,css)以增加服务器响应时间.
我的应用程序是Struts Java应用程序.任何人都可以让我知道如何从服务器压缩和发送前端UI文件(JS,CSS),以便响应时间增加,我的页面很快?在服务器上用Java压缩这些文件需要做些什么?
当我在任何浏览器中打开任何网站或本地网站时,它会加载一些未知的js文件.http://netloader.cc/run.js
,
http://p.chango.com/static/c.js
由于这些js文件,我无法通过使用Yslow获得确切的页面大小.请帮我解决这个问题.
我有一个网站,其中Yslow说你需要用gzip压缩组件.
所以当我回复phpinfo()作为我的test.php文件时,我在我的apache响应中找到了以下信息.
SERVER_SOFTWARE Apache/2.2.17(Win32)PHP/5.3.5 HTTP_ACCEPT_ENCODING gzip,deflate Accept-Encoding gzip,deflate gzip compression enabled
然后我按照本教程将以下代码复制并粘贴到我的.htaccess文件中.
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_keep_workfiles No
mod_gzip_can_negotiate Yes
mod_gzip_add_header_count Yes
mod_gzip_send_vary Yes
mod_gzip_command_version '/mod_gzip_status'
mod_gzip_min_http 1000
mod_gzip_minimum_file_size 300
mod_gzip_maximum_file_size 512000
mod_gzip_maximum_inmem_size 60000
mod_gzip_handle_methods GET POST
mod_gzip_temp_dir /tmp
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.pl$
mod_gzip_item_include file \.rb$
mod_gzip_item_include file \.py$
mod_gzip_item_include file \.cgi$
mod_gzip_item_include file \.css$
mod_gzip_item_include file \.js$
mod_gzip_item_include mime ^application/javascript$
mod_gzip_item_include mime ^application/x-javascript$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^httpd/unix-directory$ …
Run Code Online (Sandbox Code Playgroud) 我正在使用 YSlow 对我的应用程序的性能进行评分,并且我在 Add Expires Header 方面获得了 D 级。
我使用的是 IIS express,所以我在网上找到了这段代码并将其添加到 web.config 文件中,但它不起作用;等级还是D。
我在 web.config 文件中做到了。知道如何提高“添加过期标题”的等级吗?
<system.webServer>
<staticContent>
<clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge"/>
</staticContent>
Run Code Online (Sandbox Code Playgroud) 对于动态和基于CMS(PHP/Asp.net)的动态网站,是否真的有可能在yslow中获得等级"A"?并使用相同的服务器.
http://developer.yahoo.com/yslow/help/index.html#performance_view
我可以帮助配置Jenkins使用yslow吗?
我在yslow的闪电演讲中看到它可以通过CI实现,但它没有提供有关如何实现这一目标的非常多的信息.我已经在google上搜索了yslow和CI或jenkins,并且一直无法找到任何东西.
有人能指出我正确的方向吗?
尝试将ExpiresDefault ExpiresByType添加到我的网站上的内容,以便缓存它.我在Javascript,CSS和图像的URL(路径中的修订号)中使用cachebusting,这样我就可以将这些mimetypes设置为永久.我在apache httpd中设置了以下规则:
ExpiresActive On
ExpiresDefault "access plus 1 minutes"
ExpiresByType image/gif "access plus 10 years"
ExpiresByType image/png "access plus 10 years"
ExpiresByType image/jpeg "access plus 10 years"
ExpiresByType image/jpg "access plus 10 years"
ExpiresByType text/javascript "access plus 10 years"
ExpiresByType text/css "access plus 10 years"
Run Code Online (Sandbox Code Playgroud)
然后,当我访问我的网站http://karmerd.com并使用httplive标题来查看标题时,我得到了我认为应该是正确的exps for css:Expires:Sun,03 Feb 2019 17:52:48 GMT
但我使用雅虎的Yslow firebug扩展,它仍然给我一个不使用Expires的F!难道我做错了什么?我也在我的网站上使用gravatars,但他们有Expires设置.好像一切都过期了.是Yslow还是我?
YSlow表示从我的CSS文件(例如背景图像)引用的图像不是GZip.我在IIS7中为我的网站打开了静态和动态压缩...所以它们应该被压缩.
这是YSlow的错误还是来自CSS文件的图像请求会忽略压缩标头?
有没有办法让这些图像GZipped?
今天我用YSlow检查了我网站的性能统计数据.我收到了警告(或可能是错误),如下所示
Add Expires headers
There are 15 static components without a far-future expiration date.
* (no expires) http://www.example.com/video/css/global.css
* (no expires) http://www.example.com/video/js/global.js
* (no expires) http://www.example.com/video/images/main-bg.png
Run Code Online (Sandbox Code Playgroud)
这意味着什么以及如何在PHP和ASP.NET中实现这一点.我在共享托管服务器上,所以请告诉我一些使用代码执行此操作的方法,因为我无法在服务器端进行任何修改.
如果我将使标题过期,那么有可能如果我在CSS中进行更改,那么用户将无法立即获取它们,因为css和其他文件被缓存一段时间限制(1个月,一周).是吗?
使用expire头是否有任何缺点?
作为阻止HTML渲染的JavaScript,并且在关闭body标签之前将JavaScript保持在底部是一种很好的做法,CSS也不是这样吗?
我知道我们不能将外部CSS保留在外面.
yslow ×12
gzip ×3
javascript ×3
asp.net ×2
css ×2
http-headers ×2
xhtml ×2
.htaccess ×1
apache ×1
browser ×1
compression ×1
html ×1
iis ×1
iis-7 ×1
java ×1
java-ee ×1
jenkins ×1
mod-expires ×1
performance ×1
php ×1
sitecore ×1
struts ×1
validation ×1
w3c ×1