4
.. Licensed to the Apache Software Foundation (ASF) under one
5
or more contributor license agreements. See the NOTICE file
6
distributed with this work for additional information
7
regarding copyright ownership. The ASF licenses this file
8
to you under the Apache License, Version 2.0 (the
9
"License"); you may not use this file except in compliance
10
with the License. You may obtain a copy of the License at
12
http://www.apache.org/licenses/LICENSE-2.0
14
Unless required by applicable law or agreed to in writing,
15
software distributed under the License is distributed on an
16
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
KIND, either express or implied. See the License for the
18
specific language governing permissions and limitations
22
This plugin gzips or deflates responses, whichever is applicable. It can
23
compress origin respones as well as cached responses. The plugin is built
24
and installed as part of the normal Apache Traffic Server installation
30
Add the following line to
31
```plugin.config`` <../../configuration-files/plugin.config>`_::
35
In this case, the plugin will use the default behaviour:
38
- Compress text/\* for every origin
39
- Don't hide accept encoding from origin servers (for an offloading
41
- No urls are disallowed from compression
46
Alternatively, a configuration can also be specified::
48
gzip.so <path-to-plugin>/sample.gzip.config
50
After modifying plugin.cofnig, restart traffic server (sudo
51
traffic_line -L) the configuration is re-read when a management update
52
is given (sudo traffic_line -x)
57
Flags and options are:
59
``enabled``: (``true`` or ``false``) Enable or disable compression for a
62
``remove-accept-encoding``: (``true`` or ``false``) Sets whether the
63
plugin should hide the accept encoding from origin servers:
65
- To ease the load on the origins.
66
- For when the proxy parses responses, and the resulting
67
compression/decompression is wasteful.
69
``cache``: (``true`` or ``false``) When set, the plugin stores the
70
uncompressed and compressed response as alternates.
72
``compressible-content-type``: Wildcard pattern for matching
73
compressible content types.
75
``disallow``: Wildcard pattern for disabling compression on urls.
77
Options can be set globally or on a per-site basis, as such::
79
# Set some global options first
82
remove-accept-encoding false
83
compressible-content-type text/*
85
# Now set a configuration for www.example.com
88
remove-accept-encoding true
89
disallow /notthis/*.js
91
See example.gzip.config for example configurations.