{"action":"created","issue":{"url":"https://api.github.com/repos/isaacs/github/issues/611","repository_url":"https://api.github.com/repos/isaacs/github","labels_url":"https://api.github.com/repos/isaacs/github/issues/611/labels{/name}","comments_url":"https://api.github.com/repos/isaacs/github/issues/611/comments","events_url":"https://api.github.com/repos/isaacs/github/issues/611/events","html_url":"https://github.com/isaacs/github/issues/611","id":141406274,"number":611,"title":"Serve `.gz` files on GitHub Pages with the proper `Content-Encoding: gzip` header","user":{"login":"mathiasbynens","id":81942,"avatar_url":"https://avatars.githubusercontent.com/u/81942?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasbynens","html_url":"https://github.com/mathiasbynens","followers_url":"https://api.github.com/users/mathiasbynens/followers","following_url":"https://api.github.com/users/mathiasbynens/following{/other_user}","gists_url":"https://api.github.com/users/mathiasbynens/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasbynens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasbynens/subscriptions","organizations_url":"https://api.github.com/users/mathiasbynens/orgs","repos_url":"https://api.github.com/users/mathiasbynens/repos","events_url":"https://api.github.com/users/mathiasbynens/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasbynens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-16T21:22:57Z","updated_at":"2016-03-17T14:00:42Z","closed_at":null,"body":"Sent this email earlier today:\r\n\r\n> Dear GitHub Support,\r\n> \r\n> Please serve precompressed `.gz` files on GitHub Pages with the appropriate `Content-Encoding: gzip` header.\r\n> \r\n> The `Content-Type` header is already correctly set to `application/octet-stream` (see [https://mail-archives.apache.org/mod_mbox/httpd-dev/200207.mbox/raw/%3C3D2D4E76.4010502%40talex.com.pl%3E/](https://mail-archives.apache.org/mod_mbox/httpd-dev/200207.mbox/raw/%3C3D2D4E76.4010502%40talex.com.pl%3E/)). All that’s left is the `Content-Encoding` header.\r\n> \r\n> Current output:\r\n> \r\n> ```\r\n> $ curl -I https://tibiamaps.github.io/tibia-map-data/mapper/12712707.map.gz\r\n> HTTP/1.1 200 OK\r\n> Server: GitHub.com\r\n> Content-Type: application/octet-stream\r\n> Last-Modified: Tue, 15 Mar 2016 23:46:34 GMT\r\n> Access-Control-Allow-Origin: *\r\n> Expires: Wed, 16 Mar 2016 09:08:27 GMT\r\n> Cache-Control: max-age=600\r\n> X-GitHub-Request-Id: 17EB2B1E:0345:370F9E6:56E92033\r\n> Content-Length: 9014\r\n> Accept-Ranges: bytes\r\n> Date: Wed, 16 Mar 2016 09:16:53 GMT\r\n> Via: 1.1 varnish\r\n> Age: 95\r\n> Connection: keep-alive\r\n> X-Served-By: cache-ams4142-AMS\r\n> X-Cache: HIT\r\n> X-Cache-Hits: 1\r\n> X-Timer: S1458119813.598808,VS0,VE0\r\n> Vary: Accept-Encoding\r\n> X-Fastly-Request-ID: 31363c9a270ac13e51cf73d8b822435d0b6d5d96\r\n> ```\r\n> \r\n> Note that `Content-Encoding: gzip` is missing. Please add it.\r\n> \r\n> This is currently breaking an application I’m working on. As a workaround, I have to host these `.gz` files elsewhere so they get served with the proper HTTP headers. It seems weird to punish users for compressing their GitHub Pages-hosted content and saving your bandwidth.\r\n> \r\n> Thanks for considering,\r\n> Mathias\r\n\r\nI’ll update this thread if/when I get a response."},"comment":{"url":"https://api.github.com/repos/isaacs/github/issues/comments/197891049","html_url":"https://github.com/isaacs/github/issues/611#issuecomment-197891049","issue_url":"https://api.github.com/repos/isaacs/github/issues/611","id":197891049,"user":{"login":"charliesome","id":179065,"avatar_url":"https://avatars.githubusercontent.com/u/179065?v=3","gravatar_id":"","url":"https://api.github.com/users/charliesome","html_url":"https://github.com/charliesome","followers_url":"https://api.github.com/users/charliesome/followers","following_url":"https://api.github.com/users/charliesome/following{/other_user}","gists_url":"https://api.github.com/users/charliesome/gists{/gist_id}","starred_url":"https://api.github.com/users/charliesome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliesome/subscriptions","organizations_url":"https://api.github.com/users/charliesome/orgs","repos_url":"https://api.github.com/users/charliesome/repos","events_url":"https://api.github.com/users/charliesome/events{/privacy}","received_events_url":"https://api.github.com/users/charliesome/received_events","type":"User","site_admin":true},"created_at":"2016-03-17T14:00:42Z","updated_at":"2016-03-17T14:00:42Z","body":"In this case, omitting `Content-Encoding` is required for correct behaviour.\r\n\r\nBrowsers interpret the `Content-Encoding` header as describing what additional encoding has been applied to the actual content of the response when writing out the body section of the HTTP response.\r\n\r\nWhen it comes to serving literal `.gz` files, the actual content of the response is indeed in gzip format, but because there has been no *additional* gzip encoding performed by the HTTP server, setting `Content-Encoding` would be inappropriate. Setting `Content-Encoding: gzip` for `.gz` files would cause browsers to save `.gz` file on disk that has the decompressed data as its contents, rather than being a verbatim copy of the `.gz` file that was requested."}}