5 ms·
You could probably have a worker system that eventually produces a Zopfli compressed file. User uploads a provided PNG, you perform the quickest compression co
by callumjones 11y ago
You could probably have a worker system that eventually produces a Zopfli compressed file.
User uploads a provided PNG, you perform the quickest compression compression but then queue up a Zopfli compression. Up front you're only returning the less compressed file but after time you begin serving up the lesser bandwidth file.
If the uploaded file or associated post is deleted then you can wipe it from the queue.
- brianwawok 11y agoOr maybe don't even Zopfli it until it gets 100 some hits. Cost some amount of cents of CPU time to do the compress... unless maybe you made the uploaded so it.
- codinghorror 11y agoYeah the smart thing to do is schedule "important" user submitted images for heavier recompression, but even then you might get in trouble for very large PNGs, and need to gate based on dimensions. For huge PNGs I am not sure the 80x - 160x time penalty is tenable, you might be talking 30 minutes in some cases.