Gzip file serving

In my quest for a faster site I´m looking to serve gzipped files.
So I guess I have two options.
1 gzip my files in the build process
2 have the server do the gzipping for me
if I were to go for number 2 I{m I correct in thinking that I would have to add this to my headers configuration in the netlify.toml file?

Does any one have any tips or previous experience with this? Any tips greatly appreciated

3 posts were merged into an existing topic: Improved image optimisation on Netlify / Netlify Large Media

@dev1, this should be happening automatically (the server doing the gzipping for you). Most browsers automatically request the gzipped (or otherwise compressed) version of an asset with the accept-encoding header. For example, Chrome uses the following header when I test:

accept-encoding: gzip, deflate, br

Netlify will send the content gzipped with a response header like this:

content-encoding: gzip

Again, this should already be happening. If not (or if there are any questions), please let us know.