6 Ways to Reduce Your Website’s Carbon Footprint – Built In

Cloud computing has abstracted our relationships with the hardware our websites run on. Thats led to environmental benefits, like the ability to scale applications up and down on demand, ending the need for every company to operate enough servers to keep up when traffic peaks. But it also means developers are further removed from the impact their code has on the physical world.

And code does have an impact it takes energy to run applications and transmit data, so inefficient and bloated code can add up to a significant environmental impact.

Tom Greenwood, co-founder of eco-conscious digital agency Wholegrain Digital, is happy to recommend steps the average developer can take to make a difference on the environment. His book, Sustainable Web Design, details many things developers, designers and tech companies can do to make a real difference through programming websites and its a real and pressing need.

The total annual emissions from the internet were somewhere around two percent of global emissions, Greenwood said, Thats roughly the same as aviation.

The good news is that small changes can make a big difference, especially for applications with large user bases. A piece of code might run millions or billions of times in its life cycle, and the effects will be felt as long the code is deployed. Even if an application is made just slightly more energy efficient, the savings can be magnified many times over.

MORE ON GREEN COMPUTINGLooking to Go Green? Start With Modernizing Your Companys Systems.

As Greenwood explains in his book, its hard to directly measure the carbon emissions of websites. The best way is to approximate by calculating how much energy an application consumes.

Thats related to the size of the application, often encapsulated by the concept of page weight. Page weight takes the size of the initial page as well as all the additional resources requested by the browser into account.

The average page weight for websites has steadily increased over the past few years. Today, the average page weight is 2 megabytes for both desktop and mobile applications 10 years ago it was half a MB for desktop and less for mobile. Greenwood said resources like videos, large images and computationally intensive animations add lots of weight to websites. One of the most significant ways to reduce that weight is by cutting down on file sizes and trimming excess data using compression.

In our experience, you can easily reduce the amount of data on a web page by 60 percent.

In our experience, you can easily reduce the amount of data on a web page by 60 percent, Greenwood said.

Developers can start by reducing unneeded animations and deleting unused, commented-out code. They can also look for the most optimal file formats to use. For images, Greenwood recommended developers use the WebP image format developed by Google. WebP images are 26 percent smaller than PNG images and about 30 percent smaller than JPEG images of the same quality.

WebP manages these size savings through compression. While most people are familiar with compression for transferring data, such as using zip files, Greenwood said there are actually two different types of compression: one kind makes files unusable, like zip files, and another simply reduces the size of usable files.

Theyve optimized the encoding of the image, so that the same image uses less data and just has a smaller file size, Greenwood said. You can make huge gains without any functional loss, really.

Energy consumption doesnt usually come to mind when developers choose between programming languages but maybe it should. Greenwood said choosing the programming language is another way developers can have control over the carbon footprint of their application.

Some programming languages are just inherently more energy efficient than others, he said.

Research published earlier this year compared 27 different programming languages across different categories and found significant differences in energy use between languages. In the category of scripting languages, for example, PHP uses about seven times more energy than JavaScript.

JavaScript, as a web language, is relatively efficient, Greenwood said. Its not one of the most efficient like C or C++, but JavaScript is pretty good as a web language.

Thats good news, because JavaScript is a popular language and growing in adoption. Developers can consider energy use an additional incentive to switch over for older web applications.

Browsers are increasingly handling more of the work of rendering web applications. The trend started years ago with the move toward single-page applications, where new content was provided by browsers requesting specific data from the server rather than the server sending new pages.

That innovation helped with efficiency on the server side because it can cut down on the total amount of data sent, but the continuing trend with giving browsers more computational work isnt great for efficiency

Data centers are just better optimized for processing data efficiently, whereas end-user devices are relatively inefficient, Greenwood said.

He encouraged developers to push their teams to do as much computational work on the server side as possible. But either way, developers can make computations more efficient by optimizing queries. Greenwood said theres more opportunity to do that type of optimization in code that has some user interaction component to it, because the program has to calculate how to handle the user interaction.

Applications that have been layered with new functionality without streamlining are a good place to look for opportunities for optimization.

Over time, you develop these features that become more and more complicated, Greenwood said. You might have a thing where in order to click yes or no, its actually going through some long sequence.

In addition to page weight, the carbon emission of a website is tied to the energy sources used to power the companys servers.

As companies move their servers to the cloud, they lose some direct control over the energy sources used to keep their servers humming but they do have control over which cloud providers to use. Vendors offer a wide variety of choices, and even choosing which geographical locations servers should be placed in gives developers say over energy sourcing.

Differences in vendors can also go beyond energy sourcing. Some vendors offer server-side efficiencies like caching, so applications dont have to be re-generated every time a user makes a request.

The rate of change in digital can be really, really rapid compared to other industries.

Having some sort of hosting provider that will optimize that for you is just an easy win, Greenwood said.

One of the biggest advantages for web developers is that these changes are relatively easy to make, he said. Even if companies cant currently make the investment, or cant find a suitable cloud hosting vendor, that doesnt mean its not possible at some point in the future.

There are no physical things that have to be remade, redesigned or remanufactured whereas in an industry like aviation, theres billions of dollars tied up in aircrafts that need to serve out their useful lives over the next 10 years or so, Greenwood said. So the rate of change in digital can be really, really rapid compared to other industries.

Developers can help by staying on the lookout for opportunities to make changes when its possible and makes sense for their companies.

MORE ON TECH AND CLIMATEWhy Tech Plays a Crucial Role in Climate Change Research

Tech companies as a whole can help push for changes too. Greenwood said adjusting company objectives to take efficiency into account can make a big difference.

Creating a culture of efficiency is probably the single biggest thing, because everything else will then just naturally spin off of that, he said.

That can mean focusing development teams on eliminating unnecessary code and paying attention to page weight as part of their metrics. And the best news is, efficiency isnt counter to most companys overall objectives.

A lot of companies do that in other areas of their businesses, like their logistics and their manufacturing, Greenwood said. But digital, in general, is more focused on building it fast and making it look cool, rather than Lets do it really, really well and make it really efficient.

Read more:
6 Ways to Reduce Your Website's Carbon Footprint - Built In

Related Posts

Comments are closed.