Welcome to WebmasterWorld Guest from 54.162.136.26

Forum Moderators: Robert Charlton & andy langton & goodroi

Message Too Old, No Replies

Does text-to-code ratio matter? CSS external vs inline?

     
1:45 am on Aug 31, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:May 24, 2011
posts: 58
votes: 0


I could improve load time by about 100 ms by moving my external CSS inline. But would it be bad for SEO?

My CSS would add approximately 6,000 characters to each of my pages.

Is text-to-code ratio really a part of SE algo, or is it just a rumor?

Does the text-to-code ratio rally change if CSS is inline vs external?

Has anyone does some tests? Has any Google employee ever said something on this topic?

Thanks for any info you may share.
2:49 am on Aug 31, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13682
votes: 446


Wait. Do you mean inline (<td style = "text-align: left">, that kind of thing), or do you just mean page-specific?
3:53 pm on Aug 31, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 28, 2002
posts:757
votes: 0


Wouldn't that only improve load time for the first pageview, and then reduce it for subsequent pageviews? Is that worth it? What's your average pageviews per visit?
4:03 pm on Aug 31, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


CSS should go in external file so that it is loaded once per user session not once per page view.
1:33 pm on Sept 9, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:May 24, 2011
posts: 58
votes: 0


Sorry for my delay in replying.

I ended up implementing it. Now my CSS is a part of the base html file.

This is just my hobby site, so I don't mind taking risks and experimenting. It is a vBulletin-based forum, but it has been modified quite a bit for speed. For not-logged-in users, the home page now only has 3 http requests, individual forum sections have now only 2 http requests, and threads also only 2 http requests (excluding user-posted images, if any, and Adsense, if any).

Having so few http requests, I thought one request saved was a big deal percentage-wise, so I ended up doing it.
2:37 pm on Sept 9, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 12, 2004
posts:620
votes: 4


If the CSS part increases the page size over 4K (gzipped), it would be fragmented and would take 2 TCP packets. Although it is still 1 HTTP request, the page load time would be (page generation + latency*2)
2:56 pm on Sept 9, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:May 24, 2011
posts: 58
votes: 0


Thanks, Levo. Gzipped, the size before was about 5.5K, now it is just over 7K, if memory serves. That's for home page. I can look at numbers for inner pages a bit later.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members