I have a load of images - up to 16 per post plus a thumbnail and a logo. I want to figure out what the best way to handle them is. Since I'll be adding new entries quite regularly the number of images in the default uploads directory will get quite large.

Is this something I should be concerned about? As far as load times etc. I was going to create a co-gallery post type and attach the gallery images to this post type. Then set the gallery id on the Company edit page ( different post type ) to which the gallery belongs. A little code and I have an image gallery.

Or should I consider ( ad figure out how to ) uploading the images to a completely separate location/directory? Would doing this be worth the effort and is it really beneficial?

Hope that makes sense.

Thanx for your help.

  1. Reduce image size using Photoshop, smush.it, or any other decent compressor. A decent rule is .jpg for photos with lots of colors and/or details and .gif for text and under 256 colors with less details.

  2. Use exact image sizes, if you use php to resize the images make sure they are cached versions of the re-size.

  3. Use a CDN or a non shared fast host.

  4. Make the user cache the image in his browser by using;
    ExpiresByType image/jpeg "access plus 1 month" or
    <FilesMatch "\.(gif|jpg|png|js|css)$"> Expires 2592000 if your on apache ( insert your own numerical values).

By far the most important thing to do is proper compression an sizing.

  • I re-size all my images before upload so I'm good there. The main image ( used in a jquery gallery ) is no large than 600px by 600px. That's the only one that is not re-sized. I have a dedicated host, no shared hosting for me. The "ExpiresByType...." is unfamiliar to me. It looks similar to my re-write rules - is it APACHE? I think it is. Thanx a lot for the help! – dkmojo Jun 25 '11 at 12:57
  • is there a way to have both answers? Like give credit for both because I am going to use both :) – dkmojo Jun 29 '11 at 13:29
  • No but w3 total cache does not do much for images, it's for caching dynamic content, no offense to Jeremy but it's not a good answer. – Wyck Jun 29 '11 at 15:44
  • I respectfully disagree with your response to my answer. W3 Total cache helps speed up image loads in a few different ways. 1. If you set it up correctly, you can adjust the expires Headers so visitors view a cached version of your page including images. I actually had to recover a website once using the Google Cached version (images included). 2. It now repairs image redirects caused by images that have been moved or the entire website has moved. It might not be the best answer, but It is 100% worth the effort and not "bad". I didn't mention the image resizing (I consider that pretty obvious) – Jeremy Jared Jun 30 '11 at 7:54
  • I think that adding 1 line in your .htaccess > bloatware but that's just me. – Wyck Jun 30 '11 at 21:48

Have you considered using a plugin like W3 Total Cache? It allows you to used cached versions of you pages to save load time. If you configure it correctly it should greatly improve your load times.

Link to W3 Total Cache: http://wordpress.org/extend/plugins/w3-total-cache/

  • is there a way to have both answers? Like give credit for both because I am going to use both :) – dkmojo Jun 29 '11 at 13:29
  • I guess the ultimate solution would be a combined effort utilizing the methods listed here. There are a few key points I would like to bring up. Hosting your images on an image host like Flickr, or something similar would be a big help, even another hosting account if you have one would improve the load time if served from there. Take care and good luck with the optimization effort. – Jeremy Jared Jun 30 '11 at 7:58
  • I have considered using Flickr or another image host and may do that slowly after I get the site running again. Thanx again. – dkmojo Jul 5 '11 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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