# a2enmod expires
# a2enmod deflate

# vi /etc/apache2/sites-available/example.com.conf # gzip html, css and js AddOutputFilterByType DEFLATE text/html text/css application/x-javascript application/javascript

#启用过期header功能

ExpiresActive On

#缺省过期时间为“访问后的1天”

ExpiresDefault "access plus 1 days" ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType image/vnd.microsoft.icon "access plus 1 months" ExpiresByType image/x-icon "access plus 1 months" ExpiresByType image/ico "access plus 1 months" ExpiresByType application/javascript "now plus 1 months" ExpiresByType application/x-javascript "now plus 1 months" ExpiresByType text/javascript "now plus 1 months" ExpiresByType text/css "now plus 1 months"

Recent Posts