webhintio / hint

💡 A hinting engine for the web
https://webhint.io/
Apache License 2.0
3.61k stars 661 forks source link

[Hint] OptidashAI Image Optimization #4030

Open matylla opened 3 years ago

matylla commented 3 years ago

🚀 Feature request

✍️ What do you want to be added?

Official OptidashAI https://optidash.ai image optimization hint to suplement the existing tool.

💪 Are you willing to work on this?

Yes, absolutely.

✍️ Why do you want/need this?

The only check for image optimization in the Performance section is currently sponsored by Cloudinary. We believe users should have an option to choose image optimization API as they see fit.

Optidash is a pure REST API which does not enforce the use of a CDN. Optidash:

antross commented 3 years ago

Thanks @matylla, I like the idea of presenting multiple options for users.

Discussing with @sarvaje I think we'd like to approach this by replacing the existing hint-image-optimization-cloudinary with a more general hint-image-optimization that can call multiple services.

The goal is we'd warn users for any images that aren't sufficiently optimized and provide links to both services as part of the new ProblemDocumentation collection we use for linking to 3rd party resources (you can see an example of what this looks like in this PR). I'm thinking the text for each link could contain the estimated savings / final image size for each service, e.g. "Save 3KB using optidash.ai".

We should make the list of services run by the hint configurable as well so users of the CLI can customize this to only call the services they prefer.

What do you think?

matylla commented 3 years ago

Hey Tony,

I think that's an excellent idea - to create a universal connector that would allow users to choose their favorite image optimization service.

How and when do we move forward?

antross commented 3 years ago

@matylla if you're interested in opening a PR feel free to get started. You can always post it as a draft so we can give early feedback or answer any remaining open questions. If you have other questions you'd like to have answered before getting started feel free to ask here.

I'd suggest just creating the new hint and leaving the existing hint as-is for now (though feel free to copy the existing one as a starting point). When ready, we can flip these in our default configuration and deprecate/remove the old one in a separate PR.

As for authentication I suspect we'll need to coordinate on keys to use for the online scanner once this is ready to go. For users of the CLI we can support them providing their own personal key (like the existing hint does for cloudinary).