configuration-templates – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
3 | office | 1 | ######################################################################## |
4 | office | 2 | # Compression - compresses files for delivery. # |
3 | # Depends on Apache modules: # |
||
4 | # deflate, headers, setenvif, filter, mime # |
||
3 | office | 5 | ######################################################################## |
6 | |||
7 | <IfModule mod_deflate.c> |
||
8 | |||
9 | # Force compression for mangled `Accept-Encoding` request headers |
||
10 | # https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html |
||
11 | |||
12 | <IfModule mod_setenvif.c> |
||
13 | <IfModule mod_headers.c> |
||
14 | SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding |
||
15 | RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding |
||
16 | </IfModule> |
||
17 | </IfModule> |
||
18 | |||
19 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
||
20 | |||
21 | # Compress all output labeled with one of the following media types. |
||
22 | # |
||
23 | # (!) For Apache versions below version 2.3.7 you don't need to |
||
24 | # enable `mod_filter` and can remove the `<IfModule mod_filter.c>` |
||
25 | # and `</IfModule>` lines as `AddOutputFilterByType` is still in |
||
26 | # the core directives. |
||
27 | # |
||
28 | # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype |
||
29 | |||
30 | <IfModule mod_filter.c> |
||
31 | AddOutputFilterByType DEFLATE "application/atom+xml" \ |
||
32 | "application/javascript" \ |
||
33 | "application/json" \ |
||
34 | "application/ld+json" \ |
||
35 | "application/manifest+json" \ |
||
36 | "application/rdf+xml" \ |
||
37 | "application/rss+xml" \ |
||
38 | "application/schema+json" \ |
||
39 | "application/vnd.geo+json" \ |
||
40 | "application/vnd.ms-fontobject" \ |
||
41 | "application/x-font-ttf" \ |
||
42 | "application/x-javascript" \ |
||
43 | "application/x-web-app-manifest+json" \ |
||
44 | "application/xhtml+xml" \ |
||
45 | "application/xml" \ |
||
46 | "font/eot" \ |
||
47 | "font/opentype" \ |
||
48 | "image/bmp" \ |
||
49 | "image/svg+xml" \ |
||
50 | "image/vnd.microsoft.icon" \ |
||
51 | "image/x-icon" \ |
||
52 | "text/cache-manifest" \ |
||
53 | "text/css" \ |
||
54 | "text/html" \ |
||
55 | "text/javascript" \ |
||
56 | "text/plain" \ |
||
57 | "text/vcard" \ |
||
58 | "text/vnd.rim.location.xloc" \ |
||
59 | "text/vtt" \ |
||
60 | "text/x-component" \ |
||
61 | "text/x-cross-domain-policy" \ |
||
62 | "text/xml" |
||
63 | |||
64 | </IfModule> |
||
65 | |||
66 | # Map the following filename extensions to the specified |
||
67 | # encoding type in order to make Apache serve the file types |
||
68 | # with the appropriate `Content-Encoding` response header |
||
69 | # (do note that this will NOT make Apache compress them!). |
||
70 | # |
||
71 | # If these files types would be served without an appropriate |
||
72 | # `Content-Enable` response header, client applications (e.g.: |
||
73 | # browsers) wouldn't know that they first need to uncompress |
||
74 | # the response, and thus, wouldn't be able to understand the |
||
75 | # content. |
||
76 | # |
||
77 | # https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding |
||
78 | |||
79 | <IfModule mod_mime.c> |
||
80 | AddEncoding gzip svgz |
||
81 | </IfModule> |
||
82 | |||
83 | </IfModule> |