I'm optimizing my website according to Google's site optimization standards:
http://code.google.com/speed/page-sp...mageDimensions
For those who are familiar with it, I'm using Firebug -> "Page Speed" tool to analyse my site's 'weak' areas.
About the above link, image dimensions, the question is - I have lots of dynamic images on my site that are uploaded via a CMS and therefore vary in height/width. Therefore, how important is it to specify image dimensions? If a page had say 5-10 images from the CMS, which option below is better:
a) Don't specify image dimensions
b) Use PHP's getimagesize function to get the image dimension dynamically, and put it in the IMG tag as a "width" and "height"
c) Update our database to store the width/height per image (I'm already querying other info from the image table in my database, such as the text for the "alt" attribute) and then access those columns for the IMG tag on the front end?
I think "c" is the best option but I'd like to hear if anyone has any recommendation or statistics on which option is better. Obviously "c" means we need to query more data from the database.
We're also using a separate database server, and making use of browser caching. (http://code.google.com/speed/page-speed/docs/caching.html)
Thanks
c
Setting the image size will give you a better page load behaviour.
If you do not set the size some parts of the page will resize while the page loads, and that is just plain ugly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With