3 ms·
> Best practice when it comes to images on the web is to use a fixed number of sizes. What is the idea behind this? It doesn’t seem to add anything other than
by Aeolun 5y ago
> Best practice when it comes to images on the web is to use a fixed number of sizes.
What is the idea behind this? It doesn’t seem to add anything other than to leverage caching a bit better.
- ryan_lane 5y agoIt's a common DoS vector. If you limit the allowed sizes, you can predict your min/max for compute, storage, cache, networking, etc. If you allow arbitrary resizing, the client can iterate indefinitely, doing things like "give me 1x1, now 1x2, now 2x2", which will tie up your compute resources, eat up storage, push legitimate data out of your cache, etc.