2

I want to use WebP Image format for my site for image compression. However , while referring tot he docs provided by Google, i can only see support for apache and other server . But not for IIS server.

My Site is hosted usign iis server, so i need an automatic detector just like page speed does.. so that if browser doesnt have webp image format, it will simply load jpeg or png format images otherwise webp format.

I've searched over internet, i could see some paid tools. but dont want to use that. i'm sure there must be some support available for iis as well .

the link, i've refferred is :

http://blog.teamtreehouse.com/getting-started-webp-image-format

above link is good in explaining how to use pagespeed with webp for image optimization . however does not illustrate any usasge for iis server.

Does anybody have ever used pagespeed as a webp filter? or any other technique for optimizing images for better targeting lower bandwidth with heavy content and images?

Sangeeta
  • 164
  • 4
  • 16

3 Answers3

2

http://www.iispeed.com/

IISpeed is the version of mod_pagespeed for IIS. It is free for Education/Charity sites, but not for Business.

If you want a completely free version, you would have to install Apache+mod_pagespeed or nginx+ngx_pagespeed in front of your IIS server.

sligocki
  • 6,246
  • 5
  • 38
  • 47
  • can i use that for free , on my site? some of those are paid. – Sangeeta Aug 27 '14 at 05:12
  • 1
    You can see on the download page that it is Free with ads or for Education/Charity sites. $99/server for business. http://www.iispeed.com/download – sligocki Aug 29 '14 at 15:22
2

First of all if you want to automate creation of webp images, I suggest using Magick.Net library. It supports them.

Then if you want to serve webp images on IIS, you have to add a new mime type (extension webp, Mime Type image/webp).

Finally if you want to serve webp images based on the browser support you have to use URLRewrite module in order to detect support and then rewrite the request:

First add HTTP_ACCEPT on the allowed server variables that can be used. On the URLRewrite pages look right, find 'View Server Variables' and then add it.

Then create a rule that checks HTTP_ACCEPT and if webp is supported, serve it instead of jpg. A simple rule that checks this on a specific folder:

<rule name="Webp1" stopProcessing="true">
    <match url=".*Images/Products/450x675.*/([0-9]*)/(.*_.*)(\.jpg)" />
    <conditions logicalGrouping="MatchAny">
        <add input="{HTTP_ACCEPT}" pattern="\bimage/webp\b" />
    </conditions>
    <action type="Rewrite" url="Images/Products/450x675/{R:1}/{R:2}.webp" />
</rule>
zissop
  • 31
  • 2
0

If you want to generate webp files please refer below links.

https://archive.codeplex.com/?p=webp

https://github.com/JosePineiro/WebP-wrapper

Further to enable webp files in IIS, add webp format in MIME types as shown in below image.

enter image description here

Thinira
  • 361
  • 3
  • 8