<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Delighted Stupid Wind &#124; Empire Illusion &#187; Compression</title>
	<atom:link href="http://www.dswei.com/tag/compression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dswei.com</link>
	<description>Dreamland of Business, On the Way</description>
	<lastBuildDate>Sat, 13 Aug 2011 22:17:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compress The Website With GZIP Compression</title>
		<link>http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/</link>
		<comments>http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 16:55:48 +0000</pubDate>
		<dc:creator>Kent</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[GZIP]]></category>
		<category><![CDATA[mod_deflate]]></category>

		<guid isPermaLink="false">http://www.dswei.com/?p=200</guid>
		<description><![CDATA[Compression is part of User Experience stuff, improve the UE and people will feel happy for your website, then
Compression is a simple, effective way to save bandwidth and speed up your site. I hesitated when recommending gzip compression when speeding up your javascript because of problems in older browsers.
The tricky part of this exchange is [...]]]></description>
			<content:encoded><![CDATA[<p>Compression is part of User Experience stuff, improve the UE and people will feel happy for your website, then</p>
<p>Compression is a simple, effective way to save bandwidth and speed up your site. I hesitated when recommending gzip compression when speeding up your javascript because of problems in older browsers.</p>
<p>The tricky part of this exchange is the browser and server knowing it’s ok to send a zipped file over. The agreement has two parts</p>
<ul>
<li>The <strong>browser sends a header</strong> telling the server it accepts compressed content (gzip and deflate are two compression schemes): <code>Accept-Encoding: gzip, deflate</code></li>
</ul>
<ul>
<li>The <strong>server sends a response</strong> if the content is actually compressed: <code>Content-Encoding: gzip</code></li>
</ul>
<h2>Setting up the server</h2>
<p>The “good news” is that we can’t control the browser. It either sends the <code>Accept-encoding: gzip, deflate</code> header or it doesn’t.</p>
<p>Our job is to configure the server so it returns zipped content if the browser can handle it, saving bandwidth for everyone (and giving us a happy user).</p>
<p>In Apache, enabling output compression is fairly straightforward. Add the following to your .htaccess file:</p>
<pre><code>
# compress all text &amp; html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# Or, compress certain file types by extension:
&lt;Files *.html&gt;
SetOutputFilter DEFLATE
&lt;/Files&gt;
</code></pre>
<p>Apache actually has two compression options:</p>
<ul>
<li><strong>mod_deflate</strong> is easier to set up and is standard.</li>
<li><strong>mod_gzip</strong> seems more powerful: you can pre-compress content.</li>
</ul>
<p>Deflate is quick and works, so I use it; use mod_gzip if that floats your boat. In either case, Apache checks if the browser sent the “Accept-encoding” header and returns the compressed or regular version of the file. However, some older browsers may have trouble (more below) and there are special directives you can add to correct this.</p>
<p>If you can’t change your .htaccess file, you can use <span class="caps">PHP</span> to return compressed content. Give your <span class="caps">HTML </span>file a .php extension and add this code to the top:</p>
<pre><code>
In PHP:
&lt;?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?&gt;
</code></pre>
<p>We check the “Accept-encoding” header and return a gzipped version of the file (otherwise the regular version). This is almost like building your own webserver (what fun!). But really, try to use Apache to compress your output if you can help it. You don’t want to monkey with your files.</p>
<p>then you can check the compressed webpage size here: www.seositecheckup.com</p>
<p>Congratulations, your HTML is compressed. Your page is using gzip compression on your code. This helps ensure a faster loading web page and improved user experience. 79% is the percent size savings you achieved by compressing your HTML. 6.85 kb is the size of your compressed HTML.</p>
<h4>Incoming search terms for the article:</h4><ul><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="zen cart how to compress site">zen cart how to compress site</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="compress website">compress website</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="gzip javascript zen cart">gzip javascript zen cart</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="when recommending gzip">when recommending gzip</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="add gzip to webpage">add gzip to webpage</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="zen cart minify">zen cart minify</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="zen cart gzip compression">zen cart gzip compression</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="recommending gzip">recommending gzip</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="how to compress website with gzip">how to compress website with gzip</a></li><li><a href="http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/" title="how to compress website">how to compress website</a></li></ul><!-- SEO SearchTerms Tagging 2 plugin took 1.445 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.dswei.com/2009/12/compress-the-website-with-gzip-compression/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

