Compress everything except images # Insert filter SetOutputFilter DEFLATE # 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 images SetEnvIfNoCase Request_URI.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary. ![]() ![]() To enable mod_deflate on your WHM / cPanel server, make sure you run EasyApache through WHM, and select to install mod_deflate. The mod_deflate is a very useful apache module which increase the loading speed of your websites. You can enable this module simply by rebuilding your apache by using easyapache if you have server with control panel WHM/cPanel. Method I (Server with cPanel) Enable mod_deflate via easyapache. You can rebuild. Mar 31, 2010 Interact with an entire community of cPanel & WHM users! CPanel Forums > cPanel & WHM® (for Linux® Servers). How to enable mod_deflate in apache. You can enable this module simply by rebuilding your apache by using easyapache if you have server with control panel WHM. Nov 27, 2015. WHM »Service Configuration »Apache Configuration »Include Editor »Pre VirtualHost Include. And select all versions. Enable Gzip compression. Step 3: Add the following on it. Mod_deflate.c> # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems. ![]() BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE!no-gzip!gzip-only-text/html At first we probe for a User-Agent string that indicates a Netscape Navigator version of 4.x. These versions cannot handle compression of types other than text/html. The versions 4.06, 4.07 and 4.08 also have problems with decompressing html files. Thus, we completely turn off the deflate filter for them. The third directive fixes the guessed identity of the user agent, because the Microsoft Internet Explorer identifies itself also as 'Mozilla/4' but is actually able to handle requested compression. Therefore we match against the additional string 'MSIE' ( b means 'word boundary') in the User-Agent Header and turn off the restrictions defined before. The module sends a Vary: Accept-Encoding HTTP response header to alert proxies that a cached response should be sent only to clients that send the appropriate Accept-Encoding request header. This prevents compressed content from being sent to a client that will not understand it. If you use some special exclusions dependent on, for example, the User-Agent header, you must manually configure an addition to the Vary header to alert proxies of the additional restrictions. For example, in a typical configuration where the addition of the DEFLATE filter depends on the User-Agent, you should add. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |