0

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"/>
5
  • Why do you know/assume that your CSS is not transmitted compressed? Commented Mar 7, 2014 at 5:25
  • I have been detecting with YSLOW and it shows me that I need to compress css. Commented Mar 7, 2014 at 5:26
  • 1
    @ItiTyagi the firewall can also cause the unzipping of your files. Commented Mar 7, 2014 at 5:27
  • @Shekar: I am not getting this. I only need to know if I need to add some additional code for CSS compression? As I already compressed javscript and aspx pages Commented Mar 7, 2014 at 5:29
  • I don't think you need to do anything else. Commented Mar 7, 2014 at 5:33

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.