1. It is unexpected. When I click a link that ends with .tar.gz, I expect to 
get a .tar.gz file.
2. It is a waste of disk space. Sure, as soon as they download the tarball, 
they will extract it. But they still need the space for both the tarball and 
the contents at the same time. So we might as well let them conserve space if 
they want to.
3. Some programs don’t accept uncompressed .tar files; they require .tar.gz.

> On Jan 14, 2017, at 10:57 AM, Anmol Sethi <an...@aubble.com> wrote:
> 
> While it is unexpected, what is wrong with just serving a tar file and 
> redirecting a foo.gz request to a foo request? Why should a user want to have 
> a .gz file after downloading?
> 
> On Sat, Jan 14, 2017 at 1:31 PM Andy Balholm <andybalh...@gmail.com 
> <mailto:andybalh...@gmail.com>> wrote:
> It all depends on what the user wants to have when they are done downloading. 
> In the case of HTML, CSS, and JS, they want an uncompressed file that is 
> ready for their browser to use. So you should use Content-Encoding: gzip and 
> Content-Type: text/html or whatever. In the case of a .tar.gz, they may be 
> expecting to find a tar.gz file in their downloads folder, so you should use 
> Content-Type: application/gzip (not just gzip).
> 
> But rather than trying to guess what the user wants, you can go by the 
> filename in the request. If the request specifies a filename ending in .gz, 
> use Content-Type: application/gzip; if your server is adding the .gz, use 
> Content-Encoding: gzip. (And check the Accept-Encoding header too.)
> 
> Andy

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to