ArdanaLabs / DanaSwapUI

Other
3 stars 3 forks source link

Investigate/handle front-end image compression #88

Open toastal opened 2 years ago

toastal commented 2 years ago

Currently Cloudflare's server is in front of our production site. This proxy causes us 2 problems:

  1. When we run the Lighthouse tests, we will fail on performance because we aren't compressing for tests
  2. Cloudflare's compression isn't something we currently control. I'm unsure what knobs can even be turned if we can (are they compressing too aggressive or conservative?). We have 2 relevant criteria https://github.com/ArdanaLabs/apps-team/blob/master/front-end/general/performance.adoc#audiovideo-formats and https://github.com/ArdanaLabs/apps-team/blob/master/front-end/general/legal.adoc#respect-creators. If we aren't getting proper image types and are stripping important metadata, then it can't be trusted. I would be wary if we request something like JPEG and they return a different mime type like image/webp.

This may involve the <picture> tag. It's possible we may be able to emulate what that server is doing.