Store multiple image sizes or just keep the main size and resize?

I am working on a CMS and I am trying to figure out common practice for performing a REST style image request. I have three sizes, small, medium and full. My thought is to save only the full text and write a function that will resize each request per page. This has obvious processor costs. The other end is that I can store all three sizes and only calculate at boot time, this seems to be empty space.

My environment is an intranet, so there are relatively low requests and a large number of saved images. Thoughts?

Note. I understand that I don’t need to worry too much, as it’s an intranet, and any solution will work just by wondering what would be preferable for the sake of knowledge.

+3
source share
7 answers

Another option is to save the resized image cache. Serve those 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 processor and storage issues.

+3
source

Save everything, then generate other sizes as needed and cache them; page processing will be slightly slowed down by the first request, but then the cached version will be used for all subsequent requests.

+1

, , , resize-on-fly, , , .

, - MRU ( ) n- , , , , , !;)

+1

REST HTTP- - , ; , . .

+1

( ), . , , .

, , , , ..

0

, CPU-Space. , , .

0

We use the real-time resize concept for a real-world web application. check this link: http://test.bizbnk.com/ResizedImage/From/Content/Images/Ads/ad_201d1aa49015a2cc9cca1866630b02bf.png,Size=256X256 All performance tests were successful. You just need to really care about good caching (runtime, server, and client side). Good luck.

0
source

All Articles