So I did a webGL build - that finished successfully.
Now I wish to post this to my server, the content works when I try to access it through my local IIS (127.0.0.1) on my build machine (not using the gzip pipe maybe?).
However the gzipped extensions I can not figure out how to serve.
this is what I did:
-
Upload to server (I was not clear if I had to actually upload the two huge .mem and .data file in /DATA, from my reading of the rewrite rules below, “No, I do not have to” since all requests for those files will be redirected to their pre-compressed cousins. (but I did anyways to be sure) EDIT: You do NOT need to upload the huge files
-
checked that the web.config was being honoured to serve out the .mem and .data stuff
-
Imported the rules into URL rewrite via the IMPORT RULES button and double checked they were sensible. They all seemed fine - 4 rules - redirecting unzipped requests to zipped equivalents.
-
Checked that the server has dynamic and static compression installed and enabled for the domain (which it does)
-
revisited the .htaccess to see what I had missed.
It’s the final bit where in the .htaccess it would have been handled by:
AddEncoding gzip .jsgz
AddEncoding gzip .datagz
AddEncoding gzip .memgz
AddEncoding gzip .unity3dgz
I /think/ it is this bit maybe where it goes wrong. Not sure how to do this is IIS?
EDIT: Complete solution below
Many thanks.
Here is what I had scrabbled together so far
Hmm… well more digging says: That the following could have been an alternate solution for one part at least? perhaps both?
<rewrite>
<outboundRules>
<rule name="Rewrite JSGZ header" preCondition="IsJSGZ" stopProcessing="true">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<rule name="Rewrite MemGZ header" preCondition="IsMemGZ" stopProcessing="true">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<rule name="Rewrite DataGZ header" preCondition="IsDataGZ" stopProcessing="true">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<preConditions>
<preCondition name="IsJSGZ">
<add input="{PATH_INFO}" pattern="\.jsgz$" />
</preCondition>
<preCondition name="IsMemGZ">
<add input="{PATH_INFO}" pattern="\.memgz$" />
</preCondition>
<preCondition name="IsDataGZ">
<add input="{PATH_INFO}" pattern="\.datagz$" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".jsgz" mimeType="application/x-javascript" />
<mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".memgz" mimeType="application/octet-streamt" />
</staticContent>
I’m total guessing here.
Really, are there any docs?
EDIT: found some more info
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL /games/WebGL/Compressed/UnityProgress/.jsgz
Physical Path \games\WebGL\Compressed\UnityProgress\.jsgz
Looks like the rewrite is not working as expected…