Improve CO² footprint #39

Open
opened 2020-06-23 15:32:10 +00:00 by phryk · 1 comment
phryk commented 2020-06-23 15:32:10 +00:00 (Migrated from rnd.phryk.net)

In the spirit of https://dannyvankooten.com/website-carbon-emissions/,
we should work at reducing poobrains' CO² footprint.

As a first step, we shall improve poobrains/themes/default/bg.svg,
which currently renders 1400 <use> elements for the hexagonal
background, leading to it being 4 times bigger than the compiled
main.scss, which (barring fonts) is the second largest theme resource.

SVG has some kind of pattern support and it should™ work for this,
greatly reducing filesize.

Additionally, firefox currently caches fonts, but not SVG theme resources,
this should also be fixed, if possible.

In the spirit of https://dannyvankooten.com/website-carbon-emissions/, we should work at reducing poobrains' CO² footprint. As a first step, we shall improve `poobrains/themes/default/bg.svg`, which currently renders 1400 `<use>` elements for the hexagonal background, leading to it being 4 times bigger than the compiled main.scss, which (barring fonts) is the second largest theme resource. SVG has some kind of pattern support and it should™ work for this, greatly reducing filesize. Additionally, firefox currently caches fonts, but not SVG theme resources, this should also be fixed, if possible.
phryk commented 2020-06-23 16:17:08 +00:00 (Migrated from rnd.phryk.net)

Setting r.cache_control.private = True (in addition to the already present public = True) in poobrains.Poobrain.serve_theme_resources fixes the client-side caching issue. Coming in the next commit.

Setting `r.cache_control.private = True` (in addition to the already present `public = True`) in `poobrains.Poobrain.serve_theme_resources` fixes the client-side caching issue. Coming in the next commit.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: phryk-evil-mad-sciences-llc/poobrains#39
No description provided.