I'd really like to see us bring a module like TinyPNG, Images Optimizer or Image Optimize into Drupal Core.

I realize the many problems of tying in an external service, so really just want that type of basic processing that any image should have when it is uploaded to the web. It has to respect FOAF info of the file and be lossless. Would need to be able to be overridden in case there are problems. But most images uploaded to the web should be compressed first and most content authors don't do this or don't do it consistently.

There are great resources out there about why this is important for our planet https://serving.green/

There are terrific books on the subject (which I've contributed a bit to).

I've blogged a bit about approaches for Drupal here https://openconcept.ca/blog/mike/tips-sustainable-drupal-7-8-website

There's a really good tool to evaluate the carbon impact of your site here https://www.websitecarbon.com/

Even just from a financial point of view, this is costing users a ot https://whatdoesmysitecost.com/

Google's also making it much more important from an SEO perspective.

There are good summaries of best practices from PreviousNext. There's also stuff to be learned from WordPress.

Let's do what we can to bring in sustainability best practices into Drupal.

Comments

mgifford created an issue. See original summary.

ndobromirov’s picture

There is already a contributed module for that: https://www.drupal.org/project/imageapi_optimize.

It will not require any core interventions. On top of that to include this functionality in core will require installed systems to have the optimizer binaries installed and available on the hosting. This is not always the case for shared hosting plans.

With that said I like the idea having that in core as part of the fast by default initiative.

mgifford’s picture

Thanks @ndobromirov - and ya, there are already contrib modules for this.

That said, if we add up all the known users of those modules there are only 16315 sites. That is basically nothing in the million or so known Drupal sites out there.

For something that benefits every site and has no downsides (that I can think of) really we should all be doing this by default. It shouldn't be an extra.

Love the idea of the fast by default initiative, but don't see docs for it anywhere. How do we loop this into that?

ndobromirov’s picture

Issue tags: +Fast By Default
xjm’s picture

Version: 9.x-dev » 8.8.x-dev

Under our continuous upgrade path and deprecation policy, feature and API additions should be added with backwards compatibility in minor releases, so moving to 8.8.x. Thanks!

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

mgifford’s picture

Looking back at this issue now.

ImageAPI Optimize looks quite flexible, it will work for D10 & 11 but does require another 3rd party system. It would be interesting to see if that could be incorporated into Drupal CMS but unsure if it would be a good candidate for Core. Image optimization should be easy, but building in a 3rd party into Core would be a problem (not matter which one).

Imagemagick could also do the trick, and has more installs.

Some MIT projects that might be worth looking at:

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.