]> git.pld-linux.org Git - packages/apache1-mod_gzip.git/blame - apache1-mod_gzip.conf
- tabs in preamble
[packages/apache1-mod_gzip.git] / apache1-mod_gzip.conf
CommitLineData
b924928a
ER
1# $Id$
2LoadModule gzip_module modules/mod_gzip.so
3
4<IfModule mod_gzip.c>
5
6########################
7### responsibilities ###
8########################
9
10# ---------------------------------------------------------------------
11# use mod_gzip at all?
12 mod_gzip_on Yes
13# (you can especially enable mod_gzip inside the central server
14# configuration but disable it inside some directories ot virtual
15# hosts by using this directive.)
16# ---------------------------------------------------------------------
17
18######################################
19### statically precompressed files ###
20######################################
21
22# ---------------------------------------------------------------------
23# let mod_gzip perform 'partial content negotiation'?
24 mod_gzip_can_negotiate Yes
25# (if this option is active and a static file is to be served in com-
26# pressed for, then mod_gzip will look for a static precompressed
27# version of this file with a defined additional extension - see next
28# directive - which would be delivered with priority. This would allow
29# for avoiding to repeatedly compress the same static file and thus
30# saving CPU time.
31# No dynamic caching of this file is provided; currently the user
32# himself is responsible for creating and updating the precompressed
33# file's content.
34# From version 1.3.19.2a mod_gzip automatically recognizes whether
35# a statically precompressed file is older than its uncompressed
36# original and in this case will serve the content of the original
37# file in uncompressed form - as to rather serve correct data than
38# outdated ones ...)
39
40# ---------------------------------------------------------------------
41# extension (suffix) for statically precompressed files
42mod_gzip_static_suffix .gz
43AddEncoding gzip .gz
44# (effect: see previous directive; this string will be appended to the
45# name of the original file.
46# be sure to configure the encoding 'gzip' for this extension as well,
47# because mod_gzip doesn't serve the content itself but simply generates
48# an Apache internal redirection to this URL. Therefore the remaining
49# Apache configuration is responsible for setting the 'Content-Encoding'
50# header properly ...
51# prior to version 1.3.19.2a this value was not configurable.)
52
53# ---------------------------------------------------------------------
54# automatic updates for statically precompressed files
55mod_gzip_update_static No
56# (if set to 'Yes', this directive (being new in version 1.3.26.1a) would
57# cause mod_gzip to automatically update an outdated version of any
58# statically precompressed file during the request, i. e. compress the
59# originally requested file and overwrite the precompressed variant
60# file with it!
61# for each automatic update of this type, mod_gzip will write a message
62# of the severity 'notice' into the Apache error_log.
63# while doing so, mod_gzip will directly read the original file's content.
64# therefore this content cannot be interpreted by any other Apache module
65# during the request. this might possibly not be what you want - hopefully
66# it will be what most users want, because it works fast this way.
67# use this configuration with a lot of care, and be sure that you don't
68# inadvertantly cause valuable files within the URL tree to be overwritten.
69# this isn't a feature to be used for mass hosting servers, especially
70# because mod_gzip might experience access control problems there - the
71# userid the Apache processes are running under need to have write access
72# to the precompressed files of all users, which may not automatically be
73# the case.)
74# ---------------------------------------------------------------------
75
76###################
77### bureaucracy ###
78###################
79# ---------------------------------------------------------------------
80# display status for mod_gzip
81mod_gzip_command_version '/mod_gzip_status'
82# (defines an URL to display the status of mod_gzip; can be specified
83# individually for each installation and protected against access via
84# <Location> section for privacy reasons)
85# ---------------------------------------------------------------------
86# The status display will look like this:
87# mod_gzip is available...
88# mod_gzip_version = 1.3.26.1a
89# mod_gzip_on = Yes/No
90# and thus will provide information about
91# - mod_gzip being installed at the server and working correctly,
92# - which version has been installed and
93# - whether mod_gzip has been set 'active' for this Location
94# (-> mod_gzip_on)
95# ---------------------------------------------------------------------
96
97#######################
98### data management ###
99#######################
100
101# ---------------------------------------------------------------------
102# Working directory for temporary files and the compression cache
103# if not specified, the following default values are used:
104# [Win32=c:\temp], [UNIX=/tmp]
105# mod_gzip_temp_dir /tmp
106# (This directory must already exist and the userid being used for
107# running the Apache server must have read and write access to this
108# directory.
109# Unlike other Apache directives an absolute path name must be specified
110# here; a relative value will not be interpreted relatively to ServerRoot.
111# This pastname must NOT be terminated with '/'.
112# For maximum performance this directory should be located on a RAM disk,
113# if the file system isn't already being cached efficiently
114# ---------------------------------------------------------------------
115# Save temporary work files [Yes, No]
116mod_gzip_keep_workfiles No
117# (one file per HTTP request - set to 'yes' for debugging purpose only!)
118# ---------------------------------------------------------------------
119
120##################
121### file sizes ###
122##################
123
124# ---------------------------------------------------------------------
125# minimum size (in bytes) for files to be compressed
126mod_gzip_minimum_file_size 500
127# (for very small files compression will produce only small absolute gains
128# [you will still save about 50% of the content, but some additional
129# 500 bytes of HTTP and TCP headers will always remain uncompressed],
130# but still produce CPU load for both client and server)
131# ---------------------------------------------------------------------
132# maximum size (in bytes) for files to be compressed
133mod_gzip_maximum_file_size 500000
134# (for very large files compression may eventually take rather long and
135# thus delay the start of the transmission.
136# Furthermode a limitation at this point prevents the server from
137# producing output of unlimited size in case of some endless loop
138# inside a CGI script - or even trying to compress streaming data -
139# which might otherwise cause the creation of a temporary file of
140# any size and even fill up the whole hard disk.
141# On the other hand, compression will have a much more perceivable
142# subjective effect for large files ... so be sure to fine-tune this
143# according to your requirements.)
144# ---------------------------------------------------------------------
145# maximum size (in bytes) for files to be compressed in memory
146mod_gzip_maximum_inmem_size 60000
147# (larger files will be compressed into the temp file directory; adapt
148# this value to your server's available main memory.
149# In mod_gzip 1.3.19.x larger values will automatically be limited to
150# 60000 because some operating systems are said to have problems
151# allocating more than 64 kb of memory at a time.
152# ---------------------------------------------------------------------
153
154####################
155### requirements ###
156####################
157
158# (see chapter about caching for problems when using these directives.)
159# ---------------------------------------------------------------------
160# Required HTTP version of the client
161# Possible values: 1000 = HTTP/1.0, 1001 = HTTP/1.1, ...
162# This directive uses the same numeric protocol values as Apache does
163# internally
164mod_gzip_min_http 1000
165# (By using this directive you may exclude old browsers, search engines
166# etc. from the compression procedure: if the user agent doesn't
167# declare itself capable of understanding at least the HTTP level
168# specified here, only uncompressed data will be delivered - no matter
169# what else it claims to be able to. The value of '1001' will especially
170# exclude Netscape 4.x. and a lot of proxy servers.)
171# ---------------------------------------------------------------------
172# HTTP methods to be handled
173# Possible values: 'GET', 'POST' or a list of both values.
174mod_gzip_handle_methods GET POST
175# (By using this directive you may particularly exclude POST requests
176# from the compression procedure. There are known cases where the
177# handling of these requests by previous mod_gzip versions could cause
178# problems.
179# Before version 1.3.19.2a this value was not configurable.)
180# ---------------------------------------------------------------------
181
182###############
183### filters ###
184###############
185
186# ---------------------------------------------------------------------
187# which files are to be compressed?
188#
189# The order of processing during each of both phases is not important,
190# but to trigger the compression of a request's content this request
191# a) must match at least one include rule in each of both phases and
192# b) must not match an exclude rule in any of both phases.
193# These rules are not minimal, they are meant to serve as example only.
194#
195# phase 1: (reqheader, uri, file, handler)
196# ========================================
197# (see chapter about caching for problems when using 'reqheader' type
198# filter rules.)
199# NO: special broken browsers which request for gzipped content
200# but then aren't able to handle it correctly
201mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
202#
203# JA: HTML-Dokumente
204mod_gzip_item_include file \.html$
205#
206# NO: include files / JavaScript & CSS (due to Netscape4 bugs)
207mod_gzip_item_exclude file \.js$
208mod_gzip_item_exclude file \.css$
209#
210# YES: CGI scripts
211mod_gzip_item_include file \.pl$
212mod_gzip_item_include handler ^cgi-script$
213#
214# phase 2: (mime, rspheader)
215# ===========================
216# YES: normal HTML files, normal text files, Apache directory listings
217mod_gzip_item_include mime ^text/html$
218mod_gzip_item_include mime ^text/plain$
219mod_gzip_item_include mime ^httpd/unix-directory$
220#
221# NO: images (GIF etc., will rarely ever save anything)
222mod_gzip_item_exclude mime ^image/
223# ---------------------------------------------------------------------
224# In fact mod_gzip is checking only the first 4 characters of the 1st
225# operand (in case of uri even the first 2 characters only, as to
226# allow for values like url).
227# ---------------------------------------------------------------------
228# The table for mod_gzip_item rules (include and exclude) cannot contain
229# more than 256 entries; when this number is exceeded mod_gzip will
230# output the message "mod_gzip: ERROR: Item index is full"
231# and report a configuration error to the Apache server.
232# ---------------------------------------------------------------------
233# The directive values described here are meant to describe the requests
234# elected for compression most exactly.
235# Especially for the mime rules it has to be made clear that the HTTP
236# header 'Content-Type' (that will be checked by mod_gzip for this rule)
237# in some cases may contain not only a MIME type but additionally a
238# character set description (charset) as well.
239# If this is the case for the requests to be handled then you need to
240# remove the '$' char at the end of the corresponding value so that now
241# only the prefix of this value will be tested for matching.
242# ---------------------------------------------------------------------
243
244##########################
245### transfer encodings ###
246##########################
247
248# ---------------------------------------------------------------------
249# Allow mod_gzip to eliminate the HTTP header
250# 'Transfer-encoding: chunked'
251# and join the chunks to one (compressable) packet
252mod_gzip_dechunk Yes
253# (this is required for handling several types of dynamically generated
254# contents, especially for CGI and SSI pages, but also for pages produced
255# by some Java Servlet interpreters.
256# ---------------------------------------------------------------------
257
258###############
259### logging ###
260###############
261
262# ---------------------------------------------------------------------
263# Extended log format (for testing the compression effect)
264LogFormat "%h %l %u %t \"%V %r\" %<s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n -< Out:%{mod_gzip_output_size}n = %{mod_gzip_compression_ratio}n pct." common_with_mod_gzip_info2
265# ---------------------------------------------------------------------
266# Create additional log file
267CustomLog logs/mod_gzip.log common_with_mod_gzip_info2
268# (surely you can redefine your normal log file format, but you mal well
269# keep its format standard compatible for evaluation by standard web
270# analysis tools. So we just create another log file.)
271# ---------------------------------------------------------------------
272# Volume computation of the delivered files inside the Apache access_log:
273# count HTTP header size (in bytes) as part of total output size
274mod_gzip_add_header_count Yes
275# (This will be more than the pure document content, but it will more
276# realistically describe the total output traffic of the HTTP request)
277# ---------------------------------------------------------------------
278
279
280###############
281### proxies ###
282###############
283# ---------------------------------------------------------------------
284# sending a 'Vary' HTTP header
285mod_gzip_send_vary Yes
286# (see chapter about caching for this directive.)
287# don't change this unless you absolutely know what you are doing!
288# ---------------------------------------------------------------------
289
290</IfModule>
291
292# vim: filetype=apache ts=4 sw=4 et
This page took 0.097043 seconds and 4 git commands to generate.