ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaie_5.4.0.1/rzaiecompression.htm

112 lines
7.2 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="topic" />
<meta name="DC.Title" content="File compression for HTTP Server (powered by Apache)" />
<meta name="abstract" content="This topic provides information on file compression and how output from your server is compressed before being sent to the client over the network." />
<meta name="description" content="This topic provides information on file compression and how output from your server is compressed before being sent to the client over the network." />
<meta name="DC.Relation" scheme="URI" content="rzaieconcepts.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzaiecompression" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>File compression for HTTP Server (powered by Apache)</title>
</head>
<body id="rzaiecompression"><a name="rzaiecompression"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">File compression for HTTP Server (powered by Apache)</h1>
<div><p>This topic provides information on file compression and how output
from your server is compressed before being sent to the client over the network.</p>
<div class="important"><span class="importanttitle">Important:</span> Information
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
It is recommended that you install the latest PTFs to upgrade to the latest
level of the HTTP Server for i5/OS. Some of the topics documented here are
not available prior to this update. See <a href="http://www-03.ibm.com/servers/eserver/iseries/software/http/services/service.html" target="_blank">http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm</a> <img src="www.gif" alt="Link outside Information Center" /> for more information. </div>
<p>Compressed output is transferred to requesting client browsers at a higher
rate of speed than noncompressed output. This decreases the amount of data
that the server needs to send over the network and improves network performance
and response times. </p>
<p>Compression and decompression is implemented by the DEFLATE filter, located
in <a href="rzaiemod_deflate.htm">Module mod_deflate</a>. The DEFLATE filter
is always inserted after RESOURCE filters like PHP or SSI. It never touches
internal subrequests. See <a href="http://httpd.apache.org/docs-2.0/mod/mod_deflate.html" target="_blank">Apache HTTP Server Version 2.0 Documentation</a> <img src="www.gif" alt="Link outside Information Center" /> for additional
information and examples on configuring the Apache server to use compression.</p>
<p>When the DEFLATE filter is used, a LoadModule is required in order to recognize
the associated directives.</p>
<blockquote><pre>LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM</pre>
</blockquote>
<div class="section" id="rzaiecompression__output"><a name="rzaiecompression__output"><!-- --></a><h4 class="sectiontitle">Output compression</h4><p>Files can be compressed
by the server before output to the client. The server can be configured to
only compress files which are located in specific containers or globally.
Directive SetOutputFilter enables compression for files in the container
where it is placed. For example:</p>
<blockquote><pre>SetOutputFilter DEFLATE</pre>
</blockquote>
<p>Files
being compressed can also be restricted to specific MIME types. In order
to configure the server to restrict compression based on MIME types, the AddOutputFilterByType
directive should be used. For example, to enable compression
only for the HTML files located in a specific directory:</p>
<blockquote><pre>&lt;Directory "/your-server-root/htdocs"&gt;
AddOutputFilterByType DEFLATE text/html
&lt;/Directory&gt;</pre>
</blockquote>
</div>
<div class="section" id="rzaiecompression__input"><a name="rzaiecompression__input"><!-- --></a><h4 class="sectiontitle">Input compression</h4><p>Compressed files require
decompression before they can be used. A filter is necessary for decompressing
a GZIP compressed request body. The DEFLATE filter is required in the input
filter chain and is set by using the SetInputFilter or the AddInputFilter.
For example:</p>
<blockquote><pre>&lt;Location /dav-area&gt;
SetInputFilter DEFLATE
&lt;/Location&gt;</pre>
</blockquote>
<p>Requests containing a Content-Encoding:
GZIP header are automatically decompressed. The Content-Length header specifies
the length of incoming data from the client, not the byte count of the decompressed
data stream. The actual length of the data will be greater than the Content-Length
header indicates after the decompression has been done.</p>
<div class="note"><span class="notetitle">Note:</span> Check your
browser to ensure it supports GZIP request bodies.</div>
</div>
<div class="section" id="rzaiecompression__proxy"><a name="rzaiecompression__proxy"><!-- --></a><h4 class="sectiontitle">Proxy servers</h4><p>Proxy servers receive a
Vary: Accept-Encoding HTTP response header to identify that a cached response
should be sent only to clients that send the appropriate Accept-Encoding request
header. The response header prevents compressed content from being sent to
a client that cannot support it.</p>
<p>Dependencies on special exclusions,
for example, the User-Agent header, can be specified with an addition to the
Vary header. The Vary header must be manually configured in order to alert
proxies of the additional restrictions. For example, where the addition of
the DEFLATE filter depends on the User-Agent, the following Very header should
be added:</p>
<blockquote><pre>Header append Vary User-Agent</pre>
</blockquote>
<p>If
compression depends on information other than request headers, set the Vary
header with a value of "<samp class="codeph">*</samp>". The "<samp class="codeph">*</samp>" prevents
compliant proxies from caching entirely. For example:</p>
<blockquote><pre>Header set Vary *</pre>
</blockquote>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaieconcepts.htm" title="This topic provides concepts of functions on HTTP Server and IBM Web Administration for i5/OS interface.">Concepts of functions of HTTP Server</a></div>
</div>
</div>
</body>
</html>