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

Reduce carbon footprint of the website #389

Open
KiritoStorm opened this issue Dec 23, 2024 · 7 comments
Open

Reduce carbon footprint of the website #389

KiritoStorm opened this issue Dec 23, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@KiritoStorm
Copy link

KiritoStorm commented Dec 23, 2024

From the status page tool, I found out there is a website to check how carbon friendly a website is.

The test gives me an E rating, which is pretty bad, but acceptible.

I don't think that this has big priority, but maybe it would make sense to do some optimizations if it doesn't change to much on the website.

It isn't just sustainability, it is also about improving performance.
Less loading time => Less carbon footprint & more performance

Some resources linked to that:
https://beleaf.au
https://sustainablewebdesign.org

@KyleDL101
Copy link
Contributor

KyleDL101 commented Dec 24, 2024

It seems like the test you checked was outdated by their standards. I did a re-test and it's dropped to F (we rewrote the backend of the site since it was previously tested).

To be honest, I've tested performance for the site using Google's tools (Lighthouse), and the Zen website gets good performance results.

@NOCanoa
Copy link
Member

NOCanoa commented Dec 26, 2024

btw @KyleDL101 only thing i can see that can be optimized alot is the fonts
ss
2.2mb is kinda alot lol

@KyleDL101
Copy link
Contributor

@NOCanoa Agreed, the fonts are the only thing that is concerning.

@NOCanoa NOCanoa added the enhancement New feature or request label Dec 31, 2024
@flyri0
Copy link

flyri0 commented Dec 31, 2024

Hi @KyleDL101,

I managed to reduce the size of both JunicodeVF-Regular.woff2 (41.94 KB) and JunicodeVF-Italic.woff2 (48.76 KB) using subsetting.
31122024182412296B

It's likely possible to make them even smaller, but that would increase maintenance overhead, as a new subset would need to be generated frequently.

According to the Junicode manual:

8.1. Subsetting Junicode

First the legalities. It is perfectly all right to create a modified version of Junicode via subsetting, compress it into a webfont (almost certainly in woff2 format), and host it on your web server. This is because “Junicode” is not a “Reserved Font Name” (which complicates web use of many fonts licensed under the Open Font License). If you are nevertheless nervous about the legal requirements of the Open Font License, you can change the font name to something arbitrary with the --obfuscate-names option of the pyftsubset program, and you can embed the Open Font License, or a link to it, in your CSS. These steps should settle any ambiguity about whether you are in compliance with the license.

Let me know if you'd like more details about the subsetting process or any other adjustments!

@KyleDL101
Copy link
Contributor

Hi @flyri0,

That's great! Did you use pyftsubset for this, or something else?

Also, please feel free to open a PR with the subset font files. This is a good change to have.

@flyri0
Copy link

flyri0 commented Jan 1, 2025

@KyleDL101 Yes, I used glyphhanger to generate a unicode range based on the main New York Times website (since the website is currently English-only). After that, I used pyftsubset to create the subsets and compress them into woff2.

Today, I managed to reduce the size even further (15 KB for each set), but I’ll run a few more tests before opening the PR.

@KyleDL101
Copy link
Contributor

@flyri0 Sounds great. Just remember that we do have accent characters in the about us page. Although I think you've already included that but just making sure. Thanks for the work!

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

No branches or pull requests

4 participants