danielthepope / trntxt

:steam_locomotive::train::train: A data-friendly UK train times site
https://trntxt.uk
MIT License
36 stars 9 forks source link

Optipng #42

Closed benfoxall closed 7 years ago

benfoxall commented 7 years ago

(note - this is branched from #41)

I'm not sure if this is very necessary - but it runs the favicon images through optipng which would reduce the size.

pros:

cons:

When I tested locally:

before: 8.1k ~100ms after: 5.7k ~200ms

… so it's pretty negligible (especially because the files are downloaded in the background). Though if you're wanting to hyper-optimise network, then maybe it'll help.

optipng

danielthepope commented 7 years ago

Now this is an interesting idea. Since I want to continue serving files whenever possible (as mentioned in #41), perhaps you could pipe through OptiPNG before saving the file to disk? The first time an icon is requested it'll take a bit longer to be delivered, but after the first request the file delivery will be quicker than it currently is. Once upon a time I had an idea to preemptively generate icons before they're requested (#18), so this would eliminate the delay caused by generating the icon in the first place