0

I have a problem. I need to make PageSpeed scores as high as possible on my website. The thing is that the website is hosted on Microsoft IIS server and I can't turn on the gzip like I used to using .htaccess file on Apache server.

I found the solution that I need to edit the web.config file and this code:

<system.webServer>
<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"/>
</system.webServer>

But it doesn't help at all and PageSpeed tests still shows that my resources like .jpg, .js or .css files doesn't have an expiration date. Although they do have a gzip properties if I inspect them in browser network tool.

Any ideas what I could do to make the website pass the tests?

The50
  • 1,096
  • 2
  • 23
  • 47
  • gzip compression is enabled by default for Azure Web Apps without any user configuration, see [Azure Web App Not Using GZip Compression](https://stackoverflow.com/questions/34006236/azure-web-app-not-using-gzip-compression). – Aaron Chen Aug 10 '17 at 09:36
  • So the PageSpeed tests just doesn't see it and automatically sets 0 score for gzip compression? – The50 Aug 10 '17 at 10:01

1 Answers1

0

You might want to consider CDN. Specially for static files like CSS, images and .js files.

CDN lets you specify a TTL and that is probably what you are looking for.

Byron Tardif
  • 1,172
  • 6
  • 16
  • @The50 By the way, adding CDN to your App Service app is very easy, check out this guide: https://azure.microsoft.com/en-us/blog/enabling-azure-cdn-from-azure-web-app-and-storage-portal-extension/ – Byron Tardif Aug 16 '17 at 17:57