I have a Github Pages repository that hosts a site that intends to run on very old mobile devices with GPRS/2G connections. My .js and .html files are HTTP layer gzip compressed as expected by GH Pages. But root/favicon.ico (MS ICO format, uncompressed bitmap internally) is always sent over the wire uncompressed by Github/Fastly even though my Browser requests Gzip, deflate and brotli. I just realized the lag on “first load” that hour on the IE 6 mobile client is very slow because my favicon.ico is 12KB uncompressed and on wireshark I move more packets for the favicon, than the rest of the HTTP GZ SPA website app html file. I do have a couple Mobile IE 6 (the horror) clients using the GH Pages site, but they can loose their favicon’s rendering if I switch to a PNG file in my repo for favicon.ico file, but really, GH should be HTTP layer compressing .ico files with GZ. Nearly EVERY site should have a favicon.ico to avoid hitting a 404 error and a massive HTML not found body being sent over the wire, only to be tossed away by the client because its not a image when an image MIME type was expected for favicon.ico GET. If GH adds gzip compressing ICO files in general, it should check that the header of each .ico file isn’t a PNG file disguised as favicon.ico because HTTP GZ on a PNG file seems to add bytes instead of taking them away because .png files are already worst case DEFLATE or best case zopfli encoded on disk/on repo. For now my fix is I switched the file to a PNG favicon.ico in my repo, but its an bandaid, I’d rather move a gziped legacy ICO file over the wire than an uncompressed on wire, but disk level compressed PNG disguised as a ICO file, for an ultra legacy client, them getting back the favicon.ico would be nice.
GET /favicon.ico HTTP/1.1 Host: tinymta.us.to User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101 Firefox/78.0 Accept: image/webp,*/* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache
HTTP/1.1 200 OK Server: GitHub.com Content-Type: image/vnd.microsoft.icon Last-Modified: Tue, 21 Jul 2020 21:00:31 GMT ETag: "5f17576f-1a1" Access-Control-Allow-Origin: * Expires: Tue, 21 Jul 2020 21:10:50 GMT Cache-Control: max-age=600 X-Proxy-Cache: MISS X-GitHub-Request-Id: 5CF4:0BE3:BE0EA1:EBA1AD:5F175782 Content-Length: 417 Accept-Ranges: bytes Date: Tue, 21 Jul 2020 21:25:34 GMT Via: 1.1 varnish Age: 0 Connection: keep-alive X-Served-By: cache-lga21981-LGA X-Cache: MISS X-Cache-Hits: 0 X-Timer: S1595366735.717915,VS0,VE13 Vary: Accept-Encoding X-Fastly-Request-ID: 514e2b30786e50d983c87619713a1f3c99d7deed