# Append the contents of this file to this .htaccess to the one in your document root or configuration file to enable http # compression and client-side (browser) caching of files that W3 Total Cache does not handle. This file can also be used # for the self-hosted subdomain used in your CDN settings. # BEGIN HTTP Compression # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 # the above regex won't work. You can use the following # workaround to get the desired effect: BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don't compress media or scripts SetEnvIfNoCase Request_URI \ \.(?:php|gif|jpe?g|png|swf|pdf|zip|tar|rar|mp3|mov|rm|ram|wav|wma|wmv|asf|avi|mpg|mpeg|tgz|qt|doc|xls|ppt)$ no-gzip$ # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary # Fragment size to be compressed at one time by zlib #DeflateBufferSize 4096 # Fragment size to be compressed at one time by zlib #DeflateCompressionLevel 9 # How much memory should be used by zlib for compression #DeflateMemLevel 9 # Zlib compression window size #DeflateWindowSize 15 # Enable HTTP Compression policy for all except .css, .js and .html documents SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/plain text/xml application/xml text/xsd text/xsl application/wlwmanifest+xml image/x-icon # END HTTP Compression # BEGIN Headers # Browser caching policy for all except .css, .js and .html documents ExpiresActive On ExpiresByType text/plain A31536000 ExpiresByType text/xml A31536000 ExpiresByType application/xml A31536000 ExpiresByType text/xsd A31536000 ExpiresByType text/xsl A31536000 ExpiresByType application/wlwmanifest+xml A31536000 ExpiresByType image/png A31536000 ExpiresByType image/jpeg A31536000 ExpiresByType image/jpg A31536000 ExpiresByType image/pjpeg A31536000 ExpiresByType image/gif A31536000 ExpiresByType image/x-icon A31536000 # Set header information for proxies Header append Vary User-Agent # Ensure client-side caching of objects Header set Cache-Control "max-age=31536000, public" # Enable Entity Tag FileETag MTime Size # END Headers