Question

I have been through this link: CSS/JS GZip Compression with Asp.Net

But this is not helping me. I even wrote the settings in web config but what about css? How do I compress that? My code in web config:

<httpCompression 
  directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>

  <dynamicTypes>
    <add mimeType="text/*" enabled="true"/>
    <add mimeType="message/*" enabled="true"/>
    <add mimeType="application/javascript" enabled="true"/>
    <add mimeType="*/*" enabled="false"/>
  </dynamicTypes>

  <staticTypes>
    <add mimeType="text/*" enabled="true"/>
    <add mimeType="message/*" enabled="true"/>
    <add mimeType="application/javascript" enabled="true"/>
    <add mimeType="*/*" enabled="false"/>
  </staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
Was it helpful?

Solution

I found one solution for the same.

There is also a setting in the IIS for enabling the static and dynamic compression. Install the dynamic compression in IIS, and this will work.

Also I cleared the cache and re deployed the application and it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top