gizp website compression

  1. Open D:\phpStudy\Apache\conf\httpd.conf

    LoadModule deflate_module modules/mod_deflate.so

    LoadModule headers_module modules/mod_headers.so

    Remove the preceding # and open these two configurations

  2.  

    Add at the end of httpd.conf

    <IfModule deflate_module>  

    #Required, like a switch, tells apache to compress the content transmitted to the browser  

    SetOutputFilter DEFLATE  

    #Compression level, 1-9, 9 is the highest

    DeflateCompressionLevel 9      

    # uncompressed files

    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary #Set not to compress image files with suffix gif, jpg, jpeg, png  

    SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary #Same as above, that is, the settings are incorrect exe, tgz, gz. . . files are compressed  

    SetEnvIfNoCase Request_URI \.(?:pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary    

    #Settings for proxy server  

    <IfModule headers_moudle>  

    Header append vary User-Agent  

    </IfModule>  

    </IfModule>

     

    Restart apache, so we have successfully enabled gzip compression.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327079434&siteId=291194637