File names ending with gz

After unzipping a compressed (.zip) file from a game site, I opened the html page to check the game it contained. The page partially loaded with a syntax error message and my Edge console cited the error as expected ';'(semicolon).

Chrome console gave syntax error as unexpected '<' . The game was working fine on the game site but the zip file they gave me was not. After a bit of research I located the actual files the game server was running, used my file mover and copied the files to my site. Same results.

Note the file name extension on screen shot to right.

After setting the project aside for a while, it dawned on me that the extensions ended in gz (not .gz), but the game was calling for .js , .data and .mem files. I was baffled as to how the game worked, but there is certainly something on their server that allows the scripts to call compressed files into use as js and data (dat) and it was obvious that was not the case on our server.

The other question was whether or not those files were actually compressed. The first step to figure this out was to rename them. Thus webgl.asm.jsgz became webgl.asm.js.gz. Then I unzipped them, noticed the file size increased greatly, and gave the game a try. Voila! it worked.

The server obviously has the capability to allow browsers to see compressed files as normal .js files. In this case the compressed file sizes are 21% to ~ 30% of the expanded files; thus saving 70 to 80% of storage space for those files.

The game files total over 42 GB and contain no image files. All graphics are coded in the js files. After I clear this for spyware, I will add it to my games index.

Games