mercredi 15 juin 2016

gzip css and js files in asp.net

I am trying to enable gzip to all css and js files in the project.

i already activate the static and dynamic compression from IIS, and added this code to "web.config" file:

<httpCompression directory="%SystemDrive%inetpubtempIIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%system32inetsrvgzip.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>

but its not working yet, in the console - network, i noticed that aspx page has Encoded-content : gzib, but not the css and js files.

Thanks

Aucun commentaire:

Enregistrer un commentaire