Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

The cost of resizing images on the fly

Posted on 2009-03-31
2
242 Views
Last Modified: 2012-05-06
My predecessor created a website for a dealer in second hand luxury cars. It has a CMS and new offers are added by the site owner. The site includes many photos of the cars. In order to have visitors see an optimal size of the photos, almost every photos is resized on-the-fly before being displayed.

By studying the visitor stats, I found out that there are a couple of car forums where the users post photos using the page which resizes the photos. The bandwidth and resizing comes from the car site. The aspx-page which does the resizing is by far the most called page in the site, it is requested an order of magnitude more often then the next most-requested page.

The site sometimes gives an Internal Server Error, which is caused - as was told us by the company which hosts the site - by memory problems. We were told to check our scripts, I did a rough check, but nothing strange caught my eye. Then I looked at the stats and thought that the resizing of images on the fly was likely the cause of the memory problems. That is my gut feeling, but I have no hard numbers about the memory cost of resizing images on the fly.

Does anyone have some information to confirm my gut feeling?
0
Comment
Question by:sybe
2 Comments
 
LVL 5

Accepted Solution

by:
Buginator earned 500 total points
ID: 24030992
Absolutely. If it's like you are describing, my best guess is that you are correct about your theory. Resizing images is a really expensive operation, and when your webserver does this on the fly everytime a user just browse your site, the resource hog must be enormous (of course depending on the popularity of your website). Remember that the images must be stored in RAM to get resized, and when you have many images multiplied with many users (clients)... I guess you understand the problem here.

So, an application, especially web applications,  should never need to resize the same images again and again. It should only do it maximum once.

If your situation is that there are no other ways to do this than resize them on the fly, then you should alter the site to use client resize instead, with css,  javascript, or xhtml, preferably the first one. But the downfall with this would of course be a bandwidth issue - your users need to download bigger images, which their browser resize anyways.

Ideally you would need to alter the code so that the server only resize each image one time.
0
 
LVL 28

Author Closing Comment

by:sybe
ID: 31564916
Thanks. Glad to have it confirmed.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question