Sitespeed: Do images require width and height attributes?
-
Currently working on a sitespeed issue, and was wondering if not having width and height for images actually do cause a problem. We simply Photoshop the resolution we require for the image and add it to the page as is. I though this would actually speed it up, but I am getting from www.gtmetrix.com that we should have them.
What's your experience? Thanks!
-
Just came across a terrific resource that reminded me you'd asked about further reading, Ben.
Check out BrowserDiet for a huge collection of resources about tuning front-end performance of websites. (You'll see #6 talks about exactly your original question)
I can also recommend reading Steve Souder's two books - High Performance Websites and Even Faster Websites - both from O'Reilly. Souders is pretty much the leading specialist in this area. He's the creator of YSlow, one of the primary tools for measuring/analyzing site speed, and is now Head Performance Engineer at Google. His website is SteveSouders.com
That'll be more than enough to get you started. Lemme know if you're still hungry for more!
Paul
P.S. The report details from tests at webpagetest.org can also teach you a huge amount, and there's a forum there run by Patrick Meenan (who built webpagetest) which is just excellent. Patrick frequently answers questions personally.
-
you're welcome, hope your site will be speeding up a lot!!!
-
Yes, thank you. We size them all to what we want on the site so we are good there. Just got done doing it, and it did make a difference. Thanks guys!
-
as Paul correctly said, if your purpose is to improve the page speed just be sure that you're not resizing the images with css/html but that you're uploading the images in that dimensions.
An image of 10241024 resized to 100100 still weights as an 1024 image so my recommendation is to resize all those images to the desired dimensions, moreover if you can use an external cdn you'll save bandwith and have those images loading outside your website. That will help reducing the loadtime of the page.
-
Perfect-O! I completely get it now. Thanks Paul. You da man!
I thought it would be faster as in my mind it was more to read, but now that I understand the loading, I get it. Guess I need to start researching how a website loads. Have any resources I can read, to up my experience with this?
I've been in development but on an application side not website side.
-
The main reason PageSpeed and YSlow recommend including width and height for images is as much the perception of page speed as the actual load time, Ben.
When you include the image dimensions, the browser can draw out the "containers" that will hold the images, reserving the space for them while they download. The browser can then go on the paint the rest of the pages CSS and objects around those "containers" without having to go back and redraw the whole page once the images have downloaded and their sizes are then known.
This gives the user the illusion of a much faster, cleaner page load, and hence the impression of a faster website.
Does that make sense?
Paul
[Edited to add: You should still keep doing what you're doing to produce "size-as" images for your pages. You don't want to be resizing images with the html dimensions, just reporting in html the actual size of the image]
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Can I cover any topic(s) or are they some required ones
Can you talk about anything (any topics) when you write about something or is google expecting to see certain topics ? Let me clarify, let's say I do "bike tours on the island of Corsica"and bike through villages that none of the companies ranking on the 1 st page ride thru. Can I still rank as long as I write good content or do I need to cover at least some of the topics covered by the companies ranking on the 1 st page ? Thank you,
Intermediate & Advanced SEO | | seoanalytics0 -
Href lang in image or video XML sitemaps
Does anyone know if it is possible/recommended/not recommended to use href lang in image or video XML sitemaps? This had not crossed my mind until recently, but a client asked me this question and I couldn't find any information on this topic.
Intermediate & Advanced SEO | | ChrisKing0 -
Image Sitemap for non indexed Products
Hi, we have several ecommerce sites. We want to do an image sitemap, as we have lots of attractive images. The question is, can you put images for non-indexed products there as well, or does that conflict with the normal sitemap (the images would be indexed, the products not)? Thanks in advance. Dieter Lang
Intermediate & Advanced SEO | | Storesco0 -
What is Google supposed to return when you submit an image URL into Fetch as Google? Is a few lines of readable text followed by lots of unreadable text normal?
I am seeing something like this (Is this normal?): HTTP/1.1 200 OK
Intermediate & Advanced SEO | | Autoboof
Server: nginx
Content-Type: image/jpeg
X-Content-Type-Options: nosniff
Last-Modified: Fri, 13 Nov 2015 15:23:04 GMT
Cache-Control: max-age=1209600
Expires: Fri, 27 Nov 2015 15:23:55 GMT
X-Request-ID: v-8dd8519e-8a1a-11e5-a595-12313d18b975
X-AH-Environment: prod
Content-Length: 25505
Accept-Ranges: bytes
Date: Fri, 13 Nov 2015 15:24:11 GMT
X-Varnish: 863978362 863966195
Age: 16
Via: 1.1 varnish
Connection: keep-alive
X-Cache: HIT
X-Cache-Hits: 1 ����•JFIF••••��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 75
��C•••••••••• •
••
••••••••• $.' ",#(7),01444'9=82<.342��C• ••••
•2!!22222222222222222222222222222222222222222222222222��•••••v••"••••••��••••••••••••••••
•���•••••••••••••}•••••••!1A••Qa•"q•2���•#B��•R��$3br�
••••%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������•••••••••••••••••••
•���••••••••••••••w••••••!1••AQ•aq•"2�••B���� #3R�•br�0 -
How get an image on a third party site rank high on goode images?
Hello, I have sometimes articles written about my product online, is there anything else I can do except make a good file name for it, perhaps I can ask the site owner to modify in the article to make it rank higher? Also on some small websites I can see that images rank very high for the specific search term that is difficult to rank for in images, if I were to contact the site with a sponsored post request, what I should make sure the site adds except filename to that sponsored post... I think there are also some other methods such as reddit to make images rank high on third party page, just need to find out how... thanks a lot
Intermediate & Advanced SEO | | bidilover0 -
Best strategy for images filenames?
Hi community! For this case, which would be the best strategy for image filenames? This is a funiture company, with its own brand. What they sell is what they have created and designed Let's think on a kitchen. And we have a page we want to rank for the primary Kw "modern kitchen", and secondaries "white modern kitchen", "modern minimalist kitchen", "modern kitchen designs". Would you use the brand name in the filenames? I mean:
Intermediate & Advanced SEO | | teconsite
---------- white-modern-kitchen-brandname.jpg
---------- modern-minimalist-kitchen-brandname.jpg
---------- modern-kitchen-brandname.jpg Would you use just the kws in the filename and the brand in the alt text?
---------- filename: white-modern-kitchen.jpg Alt: "White Modern Kitchen, Brand" or should we use the brand in both items: filename and Alt? ¿Which would be the best way to do it in this case? Any suggestions? Thank you!0 -
Do Follow and No Follow Attributes?
I have a blog on Trulia and Active Rain which are real estate websites. I see that they both are Do Follow. My question is how much link juice do these sites pass a long to my site when I write a blog post on these sites and create a link to my main site? I've heard somewhere that even though a link has a Do Follow attribute it passes little link juice in certain cases like a no follow attribute. Also, if a link is a No Follow link, does it still pass along some link juice or is it completely juiceless. Is there a way to see which sites pass the most link juice to my site? Thanks all.
Intermediate & Advanced SEO | | bronxpad1 -
Optimization for an Car Image Gallery Site
I have a site where I feature several car images and the details/press releases about those cars. So normal layout would be an article page consisting of the following: Article Text Image gallery list laid out for user to browse. Now, when a user clicks on the image, the link opens up in another page with the image as a main content and then other image belonging to same article are shown below to browse. Each of such pages with images from same article are linked to one another with 'rel'=prev/next and has a 'rel' canonical to the page with article text. Am I doing this right to prevent thin content and duplication issue? Each of the images are for same car and are related to one another. The site under question is DieselStation. Also, if you can provide a general feedback on the site's layout and architecture in terms of SEO, that would be great.
Intermediate & Advanced SEO | | ketan90