Edit

The Wagtail sustainability roadmap

Wagtail now has a proposed sustainability roadmap, to complement its existing sustainability statement.

This work was initially shared as Wagtail RFC 90: Sustainability roadmap.

Abstract

Wagtail’s carbon footprint is on the order of thousands of tons of CO2-equivalent per year. With Wagtail now having a sustainability statement and the start of documentation for sites to reduce emissions, we need a clearer roadmap to reduce the carbon footprint of Wagtail websites and Wagtail as a whole.

Creating this roadmap as an RFC will allow for community feedback, help contributors be aware of this effort as early as possible, and encourage collaboration.

To help with planning, we track possible improvements across three themes:

  1. 🔍 Measure the carbon footprint of Wagtail
  2. 📣 Spread the word
  3. 📉 Reduce the carbon footprint of Wagtail

With Wagtail being open source self-hosted software, the impact of this effort will be entirely dependent on the adoption of the improvements by Wagtail site implementers.

Supporting activities

Here are possible activities which we could take on to support the creation and delivery of this roadmap.

Key measures

With a lot of room for climate change efforts to be data-driven, we propose the following key metrics to assess the impact of possible efforts across the three themes outlined above.

Carbon footprint of Wagtail

As tons of CO2-equivalent emissions per year (tCO2e/year).

This is the total amount of carbon emissions generated by Wagtail as an open source organization and the websites using Wagtail. It includes the emissions of Wagtail project infrastructure, maintainers, contributors, and users. It includes the emissions of Wagtail websites, to the extent that they can be determined with publicly-available data.

This figure should be reported in accordance with the Greenhouse Gas Protocol (GHG). In particular, it should include all Scope 1, Scope 2, and Scope 3 emissions.

Scoring of Wagtail websites on Web Sustainability Guidelines audits

As a median, average, or other measure of the statistical distribution of scores of Wagtail websites.

The score would be a yet-to-be implemented measurement of how well a website conforms with the Web Sustainability Guidelines (WSG). At its most basic, it could be a count of how many WSG success criteria are “passed”.

The WSG aren’t well established yet, so this would require a lot of R&D work, and collaboration with the community group behind the guidelines.

Number of Wagtail websites with a Net Zero target

As an absolute count of how many websites have such targets.

Websites with specific climate commitments would count whether the targets are present due to the websites’ local legal landscape, or a commitment of the website owner’s organization, or a specific goal at the level of the individual website.

Possible improvements

🔍 Measure the carbon footprint of Wagtail

Ideal outcome: A community-wide understanding of how Wagtail websites and community efforts contribute to climate change. Methodologies we can confidently use to assess the impact of future work.

Top 3 improvements

Here are the top three improvements we would recommend prioritizing:

  1. Create a methodology to measure the carbon footprint of Wagtail websites
  2. Measure the carbon footprint of building Wagtail: Wagtail events
  3. Establish a methodology to collect data about how many Wagtail websites there are and their characteristics

All improvements

Here all are possible improvements within this area:

  • Create a methodology to measure the carbon footprint of Wagtail websites
  • Measure the carbon footprint of building Wagtail:
    • Wagtail project infrastructure
    • Wagtail events
    • Wagtail maintainers and contributors
  • Establish a methodology to collect data about how many Wagtail websites there are and their characteristics
  • Document a methodology to extrapolate the carbon footprint of all Wagtail websites from publicly-available data
  • Create a methodology to measure the footprint of specific features
  • Define more granular carbon footprint KPIs that could be referenced on a regular basis

Prior work

📣 Spread the word

Ideal outcome: Buy-in from Wagtail users and wider industry on the importance of sustainability, and the role of Wagtail in this.

Top 3 improvements

Here are the top three improvements we would recommend prioritizing:

  1. Create a sustainability team for Wagtail
  2. Refine Wagtail’s current sustainability statement, and make it more visible
  3. Publish case studies on tackling sustainability-related requirements on Wagtail projects

All improvements

Here are all possible improvements within this theme:

  • Refine Wagtail’s current sustainability statement, and make it more visible
  • Organise sustainability-themed Wagtail events
    • Sustainability sprint
    • What’s New in Wagtail – sustainability edition
    • Sustainability-themed Wagtail Space
  • Create a sustainability team for Wagtail
  • Publish case studies on tackling sustainability-related requirements on Wagtail projects
  • Write a yearly sustainability report for Wagtail
  • Improve the documentation’s “Sustainability considerations” page
  • Create a sustainability improvements pitch deck to look for funding
  • Attend sustainability events to represent Wagtail and find project sponsors
  • Rate possible Wagtail hosting providers on sustainability considerations

Prior work

📉 Reduce the carbon footprint of Wagtail

Ideal outcome: a lower carbon footprint for Wagtail websites and Wagtail as a whole.

Top six improvements

Here are our top six improvements we would recommend prioritizing:

  1. Scale-to-zero CMS database
  2. Scale-to-zero CMS server
  3. Light YouTube embeds
  4. Reporting of performance scores in the CMS
  5. Starter templates focused on sustainability
  6. Support for static sites with 90+% of CMS features

All improvements

Here are all possible improvements within this theme. Explanation of the columns:

  • Scope clarity: how well-defined is the improvement? Is it clear what the improvement is, and how it would be implemented?
  • Impact: how much of an impact would this improvement have on the carbon footprint of Wagtail websites?
  • Reach: how many Wagtail websites would this improvement affect (given the sites were to upgrade to the relevant version)?
  • Complexity: how complex would this improvement be to implement?
  • Measures: what measures would we use to assess the impact of this improvement?

Shorter user journeys

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

Cloud infrastructure

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

Media

Improvement Scope clarity Impact Reach Complexity Measures
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

CMS features

Improvement Scope clarity Impact Reach Complexity Measures
Dark mode High High 50% Low Screen energy usage
Performance budgets in the CMS Medium High 100% Medium CWV scores
Reporting of performance scores in the CMS Medium High 100% Medium CWV scores
Duplicate files Low Low 5% Medium Server-side energy usage
Starter templates focused on sustainability Medium High 1% Low Server-side energy usage

Data processing

Improvement Scope clarity Impact Reach Complexity Measures
Documentation for back-end performance issues High High 10% Low Server-side energy usage
Background workers Medium Medium 50% Medium Server-side carbon emissions
Wagtail cache tags aware of previews, drafts High High 50% Medium Server-side energy usage
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

Prior work

Prior work in Wagtail:

Prior work outside Wagtail:

Open questions

Should the Wagtail project have a Net Zero target or other formal climate commitment?

This would be unprecedented. Net Zero commitments such as the Paris Agreement, Race to Zero or the SBTi Corporate Net-Zero Standard aren’t designed for open source projects. They’re great ways to drive ambitious climate action nonetheless.

Should the Wagtail project follow Web Sustainability Guidelines?

The Web Sustainability Guidelines 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.

What do we mean by “sustainability”?

People mean different things when they talk about sustainability. This is a good statement from Wikipedia:

Sustainability is a social goal for people to co-exist on Earth over a long time. Specific definitions of this term are disputed and have varied with literature, context, and time. Experts often describe sustainability as having three dimensions (or pillars): environmental, economic, and social, and many publications emphasize the environmental dimension. In everyday use, sustainability often focuses on countering major environmental problems, including climate change, loss of biodiversity, loss of ecosystem services, land degradation, and air and water pollution.

For Wagtail, the majority of current sustainability efforts are about environmental issues and climate change in particular, but guidelines like WSG have a much broader scope.