Contributor: Aman Pandey
Mentor: Chris Adams
Project: Greener coding 💚: Backend development
Organization: Wagtail
Original idea discussion by chris adams: Greener coding:Making a 'gold' reference configuration with the Wagtail bakery app
Contributor proposal: Wagtail: Greener coding (GSoC 2023 Proposal)
The project aims to integrate green coding practices into Wagtail’s direction and make concrete improvements to reduce related carbon emissions also ensuring that the websites we build are environmentally friendly. We plan to do so by improving different parts of wagtail architecture like improving project templates, adopting internal template caching, extending image support and lazy loading, lighter embeds, job scheduling interface for asynchronous task processing, eco-friendly themes, and other processing-related optimisations.
Technologies used: django, wagtail, python
Original Greener Coding was divided into 2 parts namely 1.Greener coding: Frontend development 2.Greener coding: Backedn development. This report consist the progress for 2. Backend development.
We along with organization maintainers priortized certain tasks over the others that can be rolled out into wagtial's new release.
Our sustainable coding initiative diverged from conventional developmental trajectories, diverging significantly in its approach. The crux of its impact resides in pioneering research directed towards the reduction of carbon emissions. Our preliminary research during the coding phase unveiled several pathways for exploration, each meticulously prioritized based on complexity and feasibility for integration into forthcoming releases. These pathways encompass:
Integration of AVIF support into Willow: AVIF, a lightweight image format, demonstrates superior efficiency compared to its counterparts. Static site pages enriched with AVIF-encoded images exhibit substantially reduced load times and resource consumption compared to those incorporating alternative formats.
Extension of AVIF support to Wagtail: Building upon the successful integration of AVIF within Willow, we seamlessly extended this support to Wagtail. Concurrently, a concerted effort was made to foster adoption amongst fellow developers, encouraging the incorporation of this technology into their projects.
Implementation of "scale to zero" configurations for Wagtail sites: Leveraging serverless architectures such as neon.tech, we explored the concept of "scale to zero" configurations for Wagtail sites. This endeavor aimed to enhance resource efficiency by dynamically adapting server capacity to match traffic demands, thereby minimizing carbon footprint and operational costs.
Development of a Green Wagtail-specific debug toolbar: Addressing the need for developers to gauge the optimization levels and resource intensity of their sites and pages during the development phase, this debug toolbar emerges as a crucial tool. By providing insights into the optimization status of their projects, developers are empowered to make informed decisions that lead to more streamlined and resource-efficient outcomes.
- AVIF support for willow PR wagtail/Willow#115
- AVIF support for Wagtail PR wagtail/wagtail#10657
While we can still venture on many imporvements related to our sustaninable development but its really important for us to measure those in action to show if it actually makes any difference or not, so our next step would be to benchmark
these changes on a project using Green Metric Tool.
-
Original benchmarking on wagtial bakerydemo by Thibaud colas: bakerydemo GOLD benchmarking
-
Benchmarking the impact of AVIF over other image formats: AVIF GOLD benchmarking on demo project