File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ <system.webServer>
2
+ <rewrite>
3
+ <rules>
4
+ <rule name="webp">
5
+ <match url="(.+)\.(jpe?g|png)$" ignoreCase="false" />
6
+ <conditions logicalGrouping="MatchAll">
7
+ <add input="{HTTP_ACCEPT}" pattern="image/webp" ignoreCase="false" />
8
+ <add input="{DOCUMENT_ROOT}/{R:1}.webp" matchType="IsFile" />
9
+ </conditions>
10
+ <action type="Rewrite" url="{R:1}.webp" logRewrittenUrl="true" />
11
+ <serverVariables>
12
+ <set name="ACCEPTS_WEBP" value="true" />
13
+ </serverVariables>
14
+ </rule>
15
+ </rules>
16
+
17
+ <outboundRules>
18
+ <rule name="Set Vary header" preCondition="IsWebp">
19
+ <match serverVariable="RESPONSE_Vary" pattern=".*" />
20
+ <action type="Rewrite" value="Accept"/>
21
+ </rule>
22
+ <preConditions>
23
+ <preCondition name="IsWebp">
24
+ <add input="{ACCEPTS_WEBP}" pattern="true" ignoreCase="false" />
25
+ </preCondition>
26
+ </preConditions>
27
+ </outboundRules>
28
+
29
+ </rewrite>
30
+ <staticContent>
31
+ <mimeMap fileExtension=".webp" mimeType="image/webp" />
32
+ </staticContent>
33
+ </system.webServer>
You can’t perform that action at this time.
0 commit comments