1.配置静态缓存 在apache/conf/httpd.conf 开启expires模块 LoadModule expires_module modules/mod_expires.so 2.在apache/conf/extra/httpd.vhosts.conf添加如下配置: ExpiresActive on ExpiresByType image/gif "access plus 1 days" ExpiresByType image/jpeg "access plus 24 hours" ExpiresByType image/png "access plus 24 hours" ExpiresByType text/css "now plus 2 hour" ExpiresByType application/x-javascript "now plus 2 hours" ExpiresByType application/javascript "now plus 2 hours" ExpiresByType application/x-shockwave-flash "now plus 2 hours" ExpiresDefault "now plus 0 min" 3.检查配置,重启apache服务,OK! |
2.配置防盗链 在apache/conf/extra/httpd.vhosts.conf中添加如下配置: SetEnvIfNoCase Referer "^http://summy\.com" local_ref SetEnvIfNoCase Referer "^http://.*\.due\.com" local_ref Order Allow,Deny Allow from env=local_ref 其中 SetEnvIfNoCase Referer "^*" local_ref中*号填写自己的网址,或者你允许的referer |
编辑回复