Does Mix.Tasks.Phoenix.Digest compress images?

Hello!

According to https://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Digest.html

The output folder will contain:

  • the original file
  • a compressed file with gzip
  • a file containing the original file name and its digest
  • a compressed file containing the file name and its digest
  • a manifest file

I see my images in priv/static/manifest.json, but they are not compressed in priv/static.

Thanks!

1 Like

Debug messages while running Phoenix servers in prod always say they’re getting the content from the priv directory so I guess they’re not using compressed images if there aren’t any that dir, but I’m not 100% sure.

1 Like

So we should manually compress images and configure nginx to use it?

1 Like

I would say yes.

Thanks!

Compression of images using gzip shouldn’t really be worthwhile. Instead you should look into optimizing them with tools like jpegoptim or optipng.

4 Likes

Hm… It is an idea!
Thanks for other side opinion!

1 Like