Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7846123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:28:23+00:00 2026-06-02T17:28:23+00:00

I’m having a major performance issue. The problem is on one of my websites

  • 0

I’m having a major performance issue. The problem is on one of my websites there is a slider that calls about 180 images. Each one of those 180 images is downloaded by a client browser via an individual url. They are a mixture of gifs and jpg and I’d like to combine them into a single image; preferably a jpg since transparency isn’t an issue. The images are stored in a SQL database and are displayed via an MVC Controller. I imagine this sprite could also be created via a MVC Controller as opposed to the more traditional generic ashx handler.

I did some googling and came across a blog post by Scott Hanselman. The post explains how to combine check images and does generally what I want to do. It was written in 2005 so I’m curious if there may be a better way. I’ve been using ImageResizer on another project. I listened to the podcast by Mr. Hanselman that talks with the founder of the project about resizing images using IIS and .NET. I gleaned from that podcast, and my experience, that image manipulation in .NET and IIS can get weird.

Is it still a good idea to resize and merge images into sprites this way? I don’t want a sprite generator, I want an efficient method to combine .gif and jpg into a single image that can be used as a sprite.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:28:25+00:00Added an answer on June 2, 2026 at 5:28 pm

    I don’t suggest combining everything into a single image, as you’ll delay the ‘initial appearance’ of any images until the entire file downloads. Better to let the visible stuff load ASAP and optimize the rest for overall throughput.

    If the images are under 50KB each, for example, it may make sense to combine them as sprite images, but I’d suggest combining, say, 10 at a time. If the images are tiny, like 5KB each, 30 at a time would be reasonable.

    You’ve got a series of bottlenecks here to worry about

    1. HTTP overhead and concurrent connection limitations (sprite images help with this)
    2. Server throughput overhead (solvable with correct disk caching and edge caching)
    3. Browser rendering overhead (Sprites are best for icons and small thumbnails; they shouldn’t be gigantic, try to keep it under 1 megapixel).

    Joining existing images together and re-compressing in jpeg form can sometimes improve compression, other times it will introduce artifacts. For example, mixing line art and photographs is a bad idea. Jpeg is bad at line art. Use PNG, even PNG-8 if you want. Sometimes you’ll find that JPEG at 100% quality ends up smaller than the GIF or PNG version, but most of the time, line art is best stored in PNG form.

    If you have IDs for these photos, and plan on going the dynamic route with disk caching, it does simplify your task significantly.

    The ImageResizer library will let you ‘plug in’ to its dynamic pipeline and disk caching system quite easily.

    In this case, you’ll implement IVirtualImageProvider and IVirtualBitmapFile. See the Gradient plugin for a simple example of generating a bitmap and letting the pipeline handle the rest.

    You’ll have to define your url syntax and look for it in the FileExists and GetFile methods. Something like /combine-images.ashx?idlist=34,56,79,23&dir=horizontal&width=50&height=50.

    Then you’ll have to load up each of the images, resize it with the Managed API into a bitmap instance, and draw it on the canvas you’ve allocated.

    Most of your bottleneck will probably be in pulling the images from SQL. If you’ve got limited RAM on the server, a serial approach might be safer than a parallel one (I.e, get one image at a time from SQL, resize and draw it, dispose data, move on). If your source images are tiny to start with, a multi-threaded apprach might be okay. Just remember you need to make it fast even if it’s disk cached, because requests default to timing out after 30 seconds. Done properly, you should be able to serve a 10 image sprite in under 2 seconds with a empty disk cache, 20ms once it’s cached.

    If this seems a bit overwhelming, I do offer custom plugin development, but there is a queue.

    There are a lot of advantages to a 1 file-per-request approach, and it might be worth trying the ImageResizer’s disk cache and SqlReader plugins before hopping on the Sprite bandwagon. Not saying it’s the wrong approach, but uncached MVC+SQL can add a lot of overhead that might be contributing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.