为什么我的htaccess规则仍然生成gtmetrix,yslow expire headers错误?

时间:2013-03-17 05:37:12

标签: php .htaccess browser-cache

我在WordPress网站上的.htaccess中设置了规则。它看起来像这样:

# manual caching - force use of browser cache 
FileETag MTime Size 
<ifmodule mod_expires.c>   
   <filesmatch "\.(jpg|gif|png|css|js|ico|pdf|swf)$">
      ExpiresActive on
      ExpiresDefault "access plus 1 year"
   </filesmatch>
</ifmodule>

从我读过的内容来看,这应该照顾所有过期的标题。但是当我运行gtmetrix或yslow测试时,他们仍然会给我这样的错误:

http://fonts.googleapis.com/css?family=Anonymous+Pro%3Aregular%2Citalic%2Cbold%2Cbolditalic%7C&ver=3.5.1
http://www.thisismydomain.org/wp-content/plugins/wp-ui/css/css.php?styles=wpui-light%7Cwpui-blue%7Cwpui-red%7Cwpui-green%7Cwpui-dark%7Cwpui-quark%7Cwpui-alma%7Cwpui-macish%7Cwpui-redmond%7Cwpui-sevin&ver=3.5.1
http://assets.pinterest.com/images/PinExt.png
http://0.gravatar.com/avatar/41ff57b7b930a31656ab460e5a56d425?s=100&d=wavatar&r=G
http://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic,700,700italic&subset=latin,latin-ext
http://0.gravatar.com/css/hovercard.css?ver=201311ac
http://0.gravatar.com/css/services.css?ver=201311ac
http://0.gravatar.com/js/gprofiles.js?ver=201311ac
http://1.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=25&d=wavatar&forcedefault=y&r=G

其他页面显示过期标题的类似错误:

http://easyrotator.s3.amazonaws.com/.../FFF_arrow10_export.png (expiration not specified)
http://s7.addthis.com/js/300/addthis_widget.js (expiration not specified)
http://search.twitter.com/search.json?... (15 seconds)
http://connect.facebook.net/en_US/all.js (5 minutes)
https://apis.google.com/js/plusone.js (30 minutes)
http://c520866.r66.cf2.rackcdn.com/1/js/easy_rotator.min.js (33.2 minutes)
http://intensedebate.com/js/wordpressTemplateLinkWrapper2.php?... (60 minutes)
http://i.po.st/share/script/post-widget.js (3 hours)
http://www.thisismydomain.org/wp-content/plugins/wp-ui/css/css.php?styles=wpui-light%7Cwpui-blue%7Cwpui-red%7Cwpui-green%7Cwpui-dark%7Cwpui-quark%7Cwpui-alma%7Cwpui-macish%7Cwpui-redmond%7Cwpui-sevin&ver=3.5.1 (20 hours)

我认为这是因为那些特定的css和js不在我的域名中?在这种情况下,为了解决这个问题,我能做些什么,并提高我的速度分数?或者我还应该做些什么以获得更好的结果?对于thisism目录的那个...文件扩展名是css.php,所以我不确定如何在htaccess中为此设置一个到期日。感谢任何人提供的任何指导!

0 个答案:

没有答案