Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a theme which will have 2 configuration options for the slideshow in the header; a full width version and a half width version. The theme is also responsive and so I am trying to optimize it as much as possible from a speed point of view. I am trying to decide which approach is best.

  1. Use add_image_size() to create a new image size to use for when the user selects the half width configuration
  2. Use the full width images and re-size them using CSS

The advantage the new image size is that the slider images would be smaller, this is positive since the theme is to be responsive, however it means that every image in the library now will have an extra image created, even though only a small few of these images will actually be used in the slider.

Which would be the best approach, or is there anything else to consider?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The best approach is to serve the smaller image sizes, that is what matters to the end user. If you do the math on something like 5 slider images (large ones) you will see a pretty significant difference. Image sizes are in most cases the largest request.

The downside is simply having more storage on your server, but that doesn't effect the end-user nor is it expensive.

share|improve this answer
1  
+1. Given the typical $5 hosting packages today, I don't understand the concern with creating multiple intermediate image sizes. It is the original image sizes that would cause storage issues, not the smaller, intermediate-sized images. If your images are causing file storage quota issues: get a better host. –  Chip Bennett Jun 16 '12 at 14:58
    
Or even cloud storage, it's cheaper and I find it more reliable than a cheap host. –  Wyck Jun 16 '12 at 15:17
    
Yes that was my first thought too to be honest; maybe it was just co-incidence but when I was getting into my research on this the first few blog postings I came across were dedicated to, quote 'removing the image clutter that WordPress creates' ... which I thought a bit strange, and slightly odd, seeing as storage IS so cheap, but they swayed me obviously. On the other hand I can see why people think this way as I myself hardly ever use the medium or large image sizes as I just photoshop the image to the right size and that normally covers it. I suppose over 10 years they might add up? –  byronyasgur Jun 17 '12 at 0:22
    
I highly doubt it would add up considering that a large high quality image would be about 200kb max, at the current amazon pricing that would equal approximate 12 cents per 5000 images. –  Wyck Jun 17 '12 at 19:18
    
Agreed now ... anyway for your perusal here are the links from my history wpmu.org/delete-unused-image-files-wordpress studiograsshopper.ch/code-snippets/… clickonf5.org/5690/wordpress-tips-avoid-multiple-images It was a bit weird that those were the first few links I came across; maybe I outsmarted myself with my search criteria; it happens ;-) –  byronyasgur Jun 18 '12 at 21:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.