-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.htaccess
56 lines (49 loc) · 1.94 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# dennyhalim.com apache performance and other optimizations
# pagespeed A # yslow B # https://raw.githubusercontent.com/dennyhalim/cfg/master/pagespeed-yslow.png
# the f is external factor, which mean you need to purchase cdn and use better cms
# direct download this file:
# wget https://is.gd/yslow
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml text/javascript application/javascript application/x-javascript application/x-httpd-php
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "max-age=1814400, public"
Header set Expires "access plus 3 weeks"
</IfModule>
<FilesMatch "\.(pl|php|cgi|htm|html)$">
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "max-age=10, public"
Header set Expires "access plus 10 seconds"
</IfModule>
</FilesMatch>
#failover, if either mod_headers or mod_expires not installed, it'll still works
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 3 weeks"
ExpiresByType text/html "access plus 10 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
##ExpiresByType text/javascript "access plus 3 weeks"
</IfModule>
Options -Indexes
#<Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
#</Limit>
#<LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
#</LimitExcept>
#additionals:
#####more control#<FilesMatch "\.(pdf|mpg|mpeg|mp3|mp4|ogv|jpg|jpeg|png|gif|ico|js|css)$">
#ExpiresByType text/css "access plus 3 weeks"
#ExpiresByType application/pdf "access plus 3 weeks"
#ExpiresByType application/x-shockwave-flash "access plus 3 weeks"
#ExpiresByType image/gif "access plus 7 months"
#ExpiresByType image/jpg "access plus 7 months"
#ExpiresByType image/jpeg "access plus 7 months"
#ExpiresByType image/png "access plus 7 months"
#ExpiresByType image/x-icon "access plus 7 months"
#Header merge Cache-Control "public"