owid-grapher
owid-grapher copied to clipboard
Asset optimization (image, CSS, JS)
Capturing suggestions made by an external contributor that came through https://github.com/owid/owid-issues/issues/370:
- Make enormous images (timeglass etc.) smaller and/or optimize using e.g. ImageOptim. I could reduce the file size of these by more than 40% just by lossless optimization, no resizing. This is rather general and could be used to improve other pages as well.
- Make sure all minify and compress options are enabled in Netlify. If the combine JS/CSS options are disabled, enabling them would give a speed boost too, but has to be done carefully and preferably tested in a staging environment first. (Combining files can cause trouble if you’re unlucky.) This is site-wise and could give a speed boost to the entire website.
How much effort do you think both of these points would take?
The sense from DanielB & I is that the first one could be tackled quickly, but that the second could gradually blow out. Appetite would be less than 3d I think.
@larsyencken I don't think the ratio risk/reward is in favour of pushing the CSS / JS further along those lines, given that:
- we're already minifying and concatenating through webpack
- we're serving 3 JS / 2 CSS files
- requests are multiplexed through http/2
On the PNG front, we are hosting ~ 20K PNG,
$ find bakedSite/ -name \*.png | wc -l
21100
but only serving about ~ 230 "large" PNGs (by Google's definition and count).

I'm expecting these to be largely Wordpress images (since grapher exports are 850px wide, and not "google-large"). All Wordpress images are rendered through srcset responsive optimizations (although they haven't been really fined tuned).
All in all, I'm not expecting a large gain from a bandwidth perspective (but maybe this google search approximation is not very representative). On the other hand, I don't think there is much risk turning on looseless compression on Netlify (effort should be less than an hour, most of the time spent on looking side-effects).

Ah, interesting. Ok, sounds like maybe the Netlify option is the only one worth trying then.
This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.
We expect to migrate to CloudFlare Images, so we won't do more here in the meantime.