Saving Energy as a Developer

Saving Energy as a Developer
25%. That's how much electricity production contributes to greenhouse emissions.
The Internet is responsible for somewhere between 3.6% and 6.2% of global electricity use! 
You may think that, as a software developer, you don't have much of an influence on this. But you're not quite right.
Here are 10 ways how you can contribute to lower energy use!

  1. Block bots - they can consume up to 50% of bandwidth and processing. How to do that? You can utilize CloudFlare's Bot Management. I recommend CloudFlare as a CDN (explained in point 6) or your web server capabilities to block unwanted user agents.
  2. Dark mode - while it made sense on CRT monitors to use a dark background to save power, LCD has a permanent backlight, it didn't matter, but now with OLED more popular, it does make sense again.
  3. Reduce images: the more images you use, the more data needs to be transferred, and more energy is used. Maybe you can replace that image with CSS? Or if not, at least go with an efficient file format like WebP instead of JPEG.
  4. Reduce video - video is increasingly popular as a content format for the web, even as a background on various websites. Make sure it's really necessary. If it is, try at least disabling auto-play and make it as short as possible. Websites with video can weigh significantly more and put a much higher strain on the user's CPU compared to those without video, leading to a substantial increase in energy consumption.
  5. Use a data center close to your users - it might be cheaper to choose, for example, US hosting company when you have users in UK or Germany, but the energy to transmit all the data over the Atlantic will be wasted.
  6. Use CDN - if you have an audience spread around the world, it may be hard to locate your data centers close to your main audience. CDN (Content Delivery Network) offers a convenient solution by serving resources like images from a global network of data centers. As a result, usually, the largest files are loaded from the nearest CDN location to the user, reducing the amount of data that has to travel each time a page is accessed.
  7. Build static web pages - in some cases, it may be possible to simply serve static web pages with no database at all. This can be achieved by creating static HTML, CSS, and JS files for your web pages or by utilizing a static site generator or a specialized static web host to turn your CMS-powered website into static files.
  8. SEO might not appear as anything related to website efficiency, but the easier it is for a user to get the information they need, the less traffic is needed for that. As a result - less traffic and lower energy consumption.
  9. Use less JavaScript - JS impacts website efficiency in two ways - it adds file weight to the web page, so more data needs to be transferred, and it requires more computing power on the user's end. The biggest issue is loading too many libraries and not using CSS for animations when possible. And if you can't go without JS, at least try to use it efficiently.
  10. Code optimization - the more efficient your code is, the fewer unneeded calls and computations, and the less energy is required to run it. I won't provide any concrete rules here, but try to google "code optimization for energy usage," and you'll get a hint.

As you can see, the fact that you're a software developer doesn't mean you cannot have an impact on the environment. 
Also, keep in mind that some cloud providers are switching their source of electricity to renewables as much as possible, so it's an additional benefit.

If you want to have an even bigger impact on climate, you should consider joining one of the climate companies looking for software engineers!