【发布时间】:2014-06-11 20:01:11
【问题描述】:
缩小所有 css 和 js 后,为什么我的 wordpress 网站速度很慢?我使用 Ipage 托管。我在http://developers.google.com/speed/pagespeed/insights 测试我的网站,它显示桌面模式 83/100。 http://infotech-24.com这是我的网站。我的 wordpress 主题大小为 2.20MB。我没有使用任何插件
在 .htaccess 文件中,我使用此代码DirectoryIndex index.php
过期缓存##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
缓存过期
压缩文本、html、javascript、css、xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
请帮帮我
【问题讨论】:
-
为什么
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Raleway:300,400,400italic,700" >被声明了3次? -
您的网络服务器响应缓慢。问题不在于将资源提供给客户端,而是服务器开始分发资源所花费的时间。我的猜测是您的共享或 VPS 托管已超额订阅。此外,启用 gzip 压缩将有效负载大小减少约三分之二,但会增加 CPU 资源使用率,而且我认为您没有多少可用资源。
-
我使用这个主题themes.muffingroup.com/pindol我如何删除字体
-
另外,你可以用一个链接来代替用两个链接调用两种字体:fonts.googleapis.com/…" >
标签: javascript css wordpress minify