shallow丿ovejavascript
45 RewriteEngine on 46 RewriteCond %{HTTP_HOST} !^111.com$ 47 RewriteRule ^/(.*)$ http://111.com/$1 [R=301,L] 48 </IfModule> 49 <IfModule mod_expires.c> 50 ExpiresActive on 51 ExpiresByType image/gif "access plus 1 days" 52 ExpiresByType image/jpeg "access plus 24 hours" 53 ExpiresByType image/png "access plus 24 hours" 54 ExpiresByType text/css "now plus 24 hours" 55 ExpiresByType application/x-javascript "now plus 2 hours" 56 ExpiresByType application/javascript "now plus 2 hours" 57 ExpiresByType application/x-shockwave-flash "now plus 2 hours" 58 ExpiresDefault "now plus 0 min" 59 </IfModule> 60 ErrorLog "logs/111.com-error_log"
[root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl -t Syntax OK [root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl graceful
[root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl -M | grep expires [root@localhost 111.com]# vi /usr/local/apache2.4/conf/httpd.conf
[root@localhost 111.com]# vi /usr/local/apache2.4/conf/httpd.conf /expires 103 #LoadModule sed_module modules/mod_sed.so 104 #LoadModule deflate_module modules/mod_deflate.so 105 LoadModule mime_module modules/mod_mime.so 106 LoadModule log_config_module modules/mod_log_config.so 107 #LoadModule log_debug_module modules/mod_log_debug.so 108 #LoadModule logio_module modules/mod_logio.so 109 LoadModule env_module modules/mod_env.so 110 #LoadModule expires_module modules/mod_expires.so 111 LoadModule headers_module modules/mod_headers.so 112 #LoadModule unique_id_module modules/mod_unique_id.so 113 LoadModule setenvif_module modules/mod_setenvif.so 114 LoadModule version_module modules/mod_version.so 115 #LoadModule remoteip_module modules/mod_remoteip.so 116 #LoadModule proxy_module modules/mod_proxy.so 117 #LoadModule proxy_connect_module modules/mod_proxy_connect.so 118 #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
將expires模塊打開css
[root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl -M | grep expires expires_module (shared) [root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl -t Syntax OK [root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl graceful
[root@localhost 111.com]# curl -x 127.0.0.1:80 111.com/1111.png -I HTTP/1.1 200 OK Date: Sat, 04 Nov 2017 15:12:48 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Last-Modified: Sat, 04 Nov 2017 15:12:48 GMT ETag: W/"99ad-560d9271dfe00" Accept-Ranges: bytes Content-Length: 39341 Cache-Control: max-age=86400 Expires: Sun, 05 Nov 2017 15:12:48 GMT Content-Type: image/png