1

I have

plug Plug.Static,
  at: "/pros",
  from: :zipbooks,
  gzip: true,
  cache_control_for_etags: "public, max-age=604800",
  only: ~w(css assets fonts images js favicon.ico robots.txt)

and my js css and svg files are being served with content-encoding:gzip but my png files, served the same way, are not.

Here's an example of an svg and how its gzipped:

enter image description here

and heres a png

enter image description here

atomkirk
  • 3,701
  • 27
  • 30

1 Answers1

1

You need to add .png to gzippable_exts config as mentioned in the docs here.

We can optionally determine which files should be gzipped by using the :gzippable_exts option in the config file:

config :phoenix, :gzippable_exts, ~w(.js .css)

It doesn't make sense to compress png files though since they're already compressed which is why the default gzippable_exts doesn't include it.

Dogbert
  • 212,659
  • 41
  • 396
  • 397
  • 1
    You both answered the question and told me what I really needed to realize! "It doesn't make sense to compress png files" Thanks! – atomkirk Jan 23 '18 at 17:14