(一)缩短网页加载时间:IIS7.5及IIS8启用GZIP

博客 分享
0 505
优雅殿下
优雅殿下 2021-11-04 13:03:25
悬赏:0 积分 收藏

第一步:

选择需要开启的网站

第二步:

选择“压缩”

第三步:

勾选“启用动态内容压缩”和“启用静态内容压缩”,点击右侧应用按钮

第四步:

配置C:\Windows\System32\inetsrv\config\applicationhost.config,需要压缩什么类型,就自己添加MIME类型即可,找到以下内容:

     <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
            <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
            <staticTypes>
                <add mimeType="text/*" enabled="true" />
                <add mimeType="message/*" enabled="true" />
                <add mimeType="application/javascript" enabled="true" />
                <add mimeType="application/atom+xml" enabled="true" />
                <add mimeType="application/xaml+xml" enabled="true" />
                <add mimeType="image/svg+xml" enabled="true" />
                <add mimeType="application/x-javascript" enabled="true" />
         <add mimeType="image/png" enabled="true" />
        <add mimeType="image/jpeg" enabled="true" />
        <add mimeType="text/css" enabled="true" />
        <add mimeType="text/html" enabled="true" />
        <add mimeType="*/*" enabled="false" />
            </staticTypes>
            <dynamicTypes>
                <add mimeType="text/*" enabled="true" />
                <add mimeType="message/*" enabled="true" />
                <add mimeType="application/x-javascript" enabled="true" />
                <add mimeType="*/*" enabled="false" />
            </dynamicTypes>
        </httpCompression>

第五步:

配置完成后建议重启一下,在一些站长工具中查询是否GZIP功通已经启用。推荐一个站长之家https://tool.chinaz.com/

回帖
    优雅殿下

    优雅殿下 (王者 段位)

    2012 积分 (2)粉丝 (47)源码

    小小码农,大大世界

     

    温馨提示

    亦奇源码

    最新会员