<IfModule mod_deflate.c> #General Configuration settings: use ratio method and highest compression DeflateFilterNote ratio DeflateCompressionLevel 9 #Approach 1: Implicit ("Set") compression ## There are potential issues with compressing everything ## It will for example send xml compressed to web services or flash #SetOutputFilter DEFLATE #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary #SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary ##Approach 2: Explicit ("Add") compression by mime-type AddOutputFilterByType DEFLATE application/x-httpd-php AddOutputFilterByType DEFLATE application/x-httpd-fastphp AddOutputFilterByType DEFLATE application/x-httpd-eruby AddOutputFilterByType DEFLATE text/html # Or by extension # AddOutputFilter DEFLATE html AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/atom_xml AddOutputFilterByType DEFLATE application/x-javascript # Implicit compression on the way in SetInputFilter DEFLATE # Explicit compression on the way in, there is no AddInputFilterByType # AddInputFilter DEFLATE html </IfModule>
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
A complete mod_deflate configuration (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Mixed example of mod_deflate... in apache mod_deflate httpd.conf
» Suexec'ed PHP-FastCGI on Apa... in apache php fastcgi suexec
» Serve XHTML 1.1 Properly in apache httpd.conf xhtml
» Getting a copy of a x509 cer... in apache ssl openssl certifcates
» A simple WebDAV repository w... in apache httpd.conf webdav
» mod_rewrite rules to serve a... in apache xhtml modrewrite mimetype htaccess
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails