-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
71 lines (63 loc) · 3.19 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# fix access header for www. prefix of site
<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin http://www.jonaso.de
Header add Access-Control-Allow-Origin http://jonaso.de
Header add Access-Control-Allow-Origin http://localhost:8000
</IfModule>
# ------------------------------------------------------------------------------
# Compression
# ------------------------------------------------------------------------------
<IfModule mod_deflate.c>
# # Force compression for mangled headers.
# # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
# <IfModule mod_setenvif.c>
# <IfModule mod_headers.c>
# SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
# RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
# </IfModule>
# </IfModule>
#
AddOutputFilterByType DEFLATE application/javascript \
application/json \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/x-web-app-manifest+json \
application/xhtml+xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html
</IfModule>
# ------------------------------------------------------------------------------
# ETag removal
# ------------------------------------------------------------------------------
# Since we're sending far-future expires headers (see below), ETags can
# be removed: http://developer.yahoo.com/performance/rules.html#etags.
# `FileETag None` is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
# ------------------------------------------------------------------------------
# Expires headers (for better cache control)
# ------------------------------------------------------------------------------
# The following expires headers are set pretty far in the future. If you don't
# control versioning with filename-based cache busting, consider lowering the
# cache time for resources like CSS and JS to something like 1 week.
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/json "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
</IfModule>