Edward Posted April 22, 2014 Share Posted April 22, 2014 I have a website which in the future may have more than a million images on it (I HOPE SO). Images would be presented in four different sizes ranging from 100px up to 600px +. Should i save four separate images for an item so i could load the size required. (This is what i actually coded already). Or should i use the yii easyimage extension which inplements the kohana image library and enables you create each size of image you want on the fly? May be the answer to this question would be different if i had 1 million members!! I know you are a busy buy Larry but i need your advise, the things you have taught me already are considerably shortening my development time. I'm going to be there soon i can feel it. Link to comment Share on other sites More sharing options...
Larry Posted April 24, 2014 Share Posted April 24, 2014 I would definitely create sized versions once and serve them. Resizing these, or creating them, on the fly is a bad idea. It'll just be too big of a hit on your server's performance. 2 Link to comment Share on other sites More sharing options...
Edward Posted April 24, 2014 Author Share Posted April 24, 2014 Thanks Larry, that is what i originally coded, now i am going back to recode my item listing page and make it ajax submission only. I have also enabled csrf token on my site recently which caused me a major problem with my SWFUpload flash uploader which i landed up taking 6 hours to figure out the problem. Even though i had no form in my script it was still necessary to pass the csrf token in yii. In the end it turned out it was so easy to fix and all that for 6 hours work, i really thought i was going to have to make a post here but just after i thought that about that, that's when i got it, ahhhhhhhh! (Just one of those days, or two days rather.) Thanks for your help im still around...Just busy with my own problems now. Link to comment Share on other sites More sharing options...
sandy Posted April 25, 2014 Share Posted April 25, 2014 Edward - Don't create the sizes on the fly It's brutal for CPU utilization. I have had to fix up a few old Wordpress sites that relied on autosizing the images with timthumb.php. After removing that option to autosize images on the fly cpu's became quite even with the caching that it had. One other area to watch out for on some autosized images is that file size will become larger after re-sizing. I think this was related to how the resizers are set up for compression and how they do their job. Some seem to convert .jpg to .png and back to .jpg to do the work and the file sizes with default settings get larger even with smaller image sizes as I recall. And I'm just learning Yii and have had many of the 6 hour session with the ultimate conclusion wow this was easy once I figured it out Sandy 1 Link to comment Share on other sites More sharing options...
Recommended Posts