I'm working on a CMS and I'm trying to figure out the common practice for doing a REST style image request. I have three sizes, small, medium, and full. My thought is to store only the full and write a function that will resize on each page request. This has obvious cpu costs. The other end is that I could store all three sizes and only calculate on upload, this seems to waste space.
My environment is an intranet, so relatively low requests and a high number of images stored. Thoughts?
Note: I realize I don't have to really worry too much since it's intranet and either solution will work, just wondering which would be preferred for knowledge sake.
Another option is to maintain a cache of resized images. Serve up the ones that are available. Create new ones if they are not available. Delete images that have not been requested for a while.
This will be a compromise between the CPU and storage issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With