|
发表于 2013-5-26 09:54:50
|
显示全部楼层
本帖最后由 luguokankan 于 2013-5-26 10:01 编辑
基于http://wp.tutsplus.com/tutorials/hosting/optimizing-wordpress-loading-speed-with-header-php-htaccess/ 修改的
- Header unset ETag
- FileETag None
- <ifModule mod_deflate.c>
- AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
- </ifModule>
- <ifModule mod_expires.c>
- ExpiresActive On
- ExpiresDefault "access plus 5 seconds"
- ExpiresByType image/x-icon "access plus 2592000 seconds"
- ExpiresByType image/jpeg "access plus 2592000 seconds"
- ExpiresByType image/png "access plus 2592000 seconds"
- ExpiresByType image/gif "access plus 2592000 seconds"
- ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
- ExpiresByType text/css "access plus 604800 seconds"
- ExpiresByType text/javascript "access plus 216000 seconds"
- ExpiresByType application/javascript "access plus 216000 seconds"
- ExpiresByType application/x-javascript "access plus 216000 seconds"
- ExpiresByType text/html "access plus 600 seconds"
- ExpiresByType application/xhtml+xml "access plus 600 seconds"
- </ifModule>
- <ifModule mod_headers.c>
- <filesMatch "\.(ico|jpe?g|png|gif|swf)[ DISCUZ_CODE_0 ]quot;>
- Header set Cache-Control "public"
- </filesMatch>
- <filesMatch "\.(css)[ DISCUZ_CODE_0 ]quot;>
- Header set Cache-Control "public"
- </filesMatch>
- <filesMatch "\.(js)[ DISCUZ_CODE_0 ]quot;>
- Header set Cache-Control "private"
- </filesMatch>
- <filesMatch "\.(x?html?|php)[ DISCUZ_CODE_0 ]quot;>
- Header set Cache-Control "private, must-revalidate"
- </filesMatch>
- </ifModule>
复制代码 |
|