Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 90: Sustainability roadmap #90

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

thibaudcolas
Copy link
Member

@thibaudcolas thibaudcolas commented Nov 27, 2023

View the roadmap in HTML. Share this roadmap with a permanent link: wagtail.org/sustainability/sustainability-roadmap/

This addresses the two components of the Sustainability roadmap item from the Wagtail roadmap in preparation for the v6.0 release in February:

Extensive review of the Web Sustainability Guidelines, with a particular focus on applicability for the Wagtail CMS and Wagtail websites.
Refinement of a potential program of sustainability improvements to Wagtail, with the view to reduce its carbon footprint.

There is a bit more to do on sharing our review of WSG and adding items within this document, but the high-level information is there.

Reviewing this

For people reviewing this – there are a few things I would recommend:

  1. Take the Green Software for Practitioners course if you haven’t already. If you don’t want to register for the course and get a certificate, all the content is available publicly too.
  2. Suggest as many possible improvements as possible across all three sections. I would say the more the merrier.
  3. Be particularly critical of the "top 3" / "top 6" improvements. The point here is to decide on what we’d do in the very near future, so we want to make sure those are the right things to focus on.

I’m also very interested in feedback on the process here, as this is all pretty new to us and there aren’t many projects with this kind of sustainability angle, nor Wagtail contributors with this expertise.

More information

@thibaudcolas thibaudcolas changed the title Draft: RFC 90 sustainability roadmap RFC 90: sustainability roadmap Nov 27, 2023
@thibaudcolas thibaudcolas marked this pull request as ready for review November 27, 2023 14:16
@thibaudcolas thibaudcolas changed the title RFC 90: sustainability roadmap RFC 90: Sustainability roadmap Nov 27, 2023
Copy link

@willbarton willbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very initial reactions/comments/etc.

text/090-sustainability-roadmap.md Outdated Show resolved Hide resolved
text/090-sustainability-roadmap.md Outdated Show resolved Hide resolved
Comment on lines +165 to +174
| Improvement | Scope clarity | Impact | Reach | Complexity | Measures |
| --------------------------------------------------------------------------- | ------------- | ------ | ----- | ---------- | ------------------------ |
| schema.org or similar structured data as a first-party feature | Low | Low | 50% | Low | Time spent on site |
| Validation of Wagtail sites’ treatment in search knowledge graphs | Low | Low | 50% | Medium | Time spent on site |
| Yoast-style content analysis & reporting features for Wagtail sites | Low | Low | 50% | Medium | Time spent on site |
| Support for functionality like Rich Results, Web Stories, etc in CMS | Medium | Low | 5% | Low | Site page views |
| Better sitemap generation, including more of the site’s contents | Medium | Low | 5% | Low | Server-side energy usage |
| Redirects awareness, reporting, optimisation to reduce usage where possible | Low | Low | 1% | Low | Server-side energy usage |
| Canonical page awareness, reporting, optimisation to reduce duplications | Low | Low | 1% | Low | Server-side energy usage |
| Documentation of front-end performance issues in Wagtail | High | High | 10% | Low | CWV scores |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to sort these row by one of the columns (at a glance, I assumed it was sorted by Reach, but the last row is 10%)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I’d probably go for "Impact" and then "Reach" if we did that?

Comment on lines +178 to +189
| Improvement | Scope clarity | Impact | Reach | Complexity | Measures |
| ---------------------------------------------------------- | ------------- | ------ | ----- | ---------- | ------------------------ |
| Better CDN support, higher cache hit rates | Medium | Low | 10% | Medium | Server-side energy usage |
| Official "Wagtail on cloud" hosting guide | Medium | Low | 5% | Low | Server-side energy usage |
| Support for static sites with 90+% of CMS features | Medium | High | 10% | Medium | Server-side energy usage |
| Incremental rebuilds for static content | Medium | High | 1% | High | Server-side energy usage |
| Benchmarking of energy usage - scale-to-zero vs. always-on | High | Medium | 10% | Low | Server-side energy usage |
| Scale-to-zero CMS database | Medium | High | 10% | Medium | Server-side energy usage |
| Scale-to-zero CMS server on FaaS or container-as-a-service | Low | Low | 1% | High | Server-side energy usage |
| Documentation on preview / staging sites’ best practices | Low | Low | 1% | High | Server-side energy usage |
| Carbon-aware CMS server | Low | Medium | 10% | High | Server-side energy usage |
| Carbon-aware background jobs | Low | Medium | 10% | High | Server-side energy usage |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here, would it make sense to sort by one of the columns?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

Comment on lines +194 to +203
| --------------------------------------- | ------------- | ------ | ----- | ---------- | ------------------------------ |
| Responsive images | High | High | 50% | Medium | Image weight |
| Optimised Wagtail renditions | High | High | 50% | Medium | Image weight |
| AVIF images | High | High | 50% | Medium | Image weight |
| WebP images | High | High | 50% | Medium | Image weight |
| Lossless image optimisation (PNG) | High | High | 50% | Medium | Image weight |
| Lossy image optimisation (PNG, MozJPEG) | High | High | 50% | Medium | Image weight |
| Lazy-loading of images | Medium | High | 50% | Low | Image weight |
| Optional site images (low-carbon site) | Medium | High | 1% | Low | Image weight |
| Light YouTube embeds | High | High | 10% | Low | YouTube embed weight reduction |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again... although this might be sorted by complexity?

Comment on lines +248 to +250
This would be unprecedented.
Net Zero commitments such as the [Paris Agreement](https://unfccc.int/process-and-meetings/the-paris-agreement), [Race to Zero](https://unfccc.int/climate-action/race-to-zero-campaign) or the [SBTi Corporate Net-Zero Standard](https://sciencebasedtargets.org/net-zero) aren't designed for open source projects.
They’re great ways to drive ambitious climate action nonetheless.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there are implications from calculating Wagtail's carbon footprint on this one that might be worth noting for discussion. If we're including that in the Wagtail project's overall carbon footprint, I think there's some imprecision in any claims to net zero and risk that decisions made wholly independent of the Wagtail project could impact a net zero target.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand @willbarton, on the imprecisions in particular? From my understanding you’re right, but this is the case with all carbon footprint accounting / Net Zero claims and wouldn’t be specific to Wagtail or open source more widely.

Comment on lines +254 to +256
The [Web Sustainability Guidelines](https://w3c.github.io/sustyweb/) are a set of guidelines to help organizations reduce the environmental impact of their websites.
They are currently authored by a _Community Group_ at W3C, and as such don’t have the authoritativeness of web standards.
They’re still in draft, and not (yet) widely adopted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be controversial? Are there reasons not to follow the WSG (and possibly influence their development by attempting to put them into practice)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see three reasons:

  1. They’re very recent, and as such harder to make use of than more established sets of guidelines.
  2. They’re evolving fast, so there’s a chance we’d do things and have some re-work if the guidelines evolve (not super concerned about this)
  3. They encompass a wider definition of sustainability than what we’re currently aiming for here (see the last sentence below).

Copy link
Member

@lb- lb- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few passing thoughts. This is incredible @thibaudcolas !

| Better sitemap generation, including more of the site’s contents | Medium | Low | 5% | Low | Server-side energy usage |
| Redirects awareness, reporting, optimisation to reduce usage where possible | Low | Low | 1% | Low | Server-side energy usage |
| Canonical page awareness, reporting, optimisation to reduce duplications | Low | Low | 1% | Low | Server-side energy usage |
| Documentation of front-end performance issues in Wagtail | High | High | 10% | Low | CWV scores |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we consider our CSP roadmap item here. I know it's security related but from my understanding it helps browsers know when to cache things better and stops additional unexpected scripts from running in the browser. When combined with nonce usage, we get a nice set of improvements for both security and performance in the browser.

E.g. https://techdocs.akamai.com/edgeworkers/docs/content-security-policy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I don’t think I’ve seen anyone make that case but there’s probably some performance benefits

- [Granian – A Rust HTTP server for Python applications](https://github.com/emmett-framework/granian)

## Open questions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider our community platforms?

Maybe it's a bit too much scope (or not even measurable), but not only do we extensively use these tools but we also create an example for other communities. This might not need to be a comparison for adopting different platforms but it could involve insuring we see if the platforms actually have their own sustainability considerations/policy.

Off the top of my head; Slack, StackOverflow, Zoom (What's new in Wagtail, meetings), GitHub.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Definitely. Will try to think of where to add this.

| Documentation on preview / staging sites’ best practices | Low | Low | 1% | High | Server-side energy usage |
| Carbon-aware CMS server | Low | Medium | 10% | High | Server-side energy usage |
| Carbon-aware background jobs | Low | Medium | 10% | High | Server-side energy usage |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we also consider the cloud impact of Wagtail itself (our main website, docs hosting) and the CI runners?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! I’ll try to think of where to add this. I’m not sure this type of consideration needs an RFC as much, but it’s good to consider.

| Template caching for admin | High | High | 100% | Low | Server-side energy usage |
| Wagtail-aware Django debug toolbar | High | High | 5% | Low | Server-side energy usage |
| SQL performance optimisations | High | High | 50% | Medium | Server-side energy usage |
| Rewrite performance-sensitive code in Rust | Medium | Medium | 100% | Medium | Server-side energy usage |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we also consider the CSS and JS assets loading in the admin?

These may not impact the front facing parts of the website but will impact the energy usage of those accessing the admin and the servers that host the Wagtail instances.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should! I’ll add it. I’ve been trying to quantify how much usage the admin gets based on internal data about Torchbox websites. It’s really hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants