Current time: 11-14-2019, 01:55 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
With request for html page - send html AND css file
12-17-2010, 03:52 AM
Post: #1
With request for html page - send html AND css file
Rather than wait for the browser to grab the first 10 lines of the html, and then start downloading the css file - it would be faster for me to send the css file the instant the html file is requested.

Seems like there would be an apache directive for this sort of thing.

Any ideas how to do it?
Find all posts by this user
Quote this message in a reply
12-17-2010, 05:06 AM
Post: #2
RE: With request for html page - send html AND css file
Sure, it's called inline css :-)

Seriously, there's no push support in http. SPDY provides some support for hinting to the browser but the first 10 lines of HTML arrive in the first packet (certainly the first round trip) so you're not going to be able to get much faster than that.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-18-2010, 04:58 AM
Post: #3
RE: With request for html page - send html AND css file
Ok, inline css it is.

Shaved off 0.2 seconds. Thanks.
Find all posts by this user
Quote this message in a reply
12-25-2010, 10:46 PM
Post: #4
RE: With request for html page - send html AND css file
Just a quick comment, fairly obvious but worth keeping in mind: Whether in-lining CSS is a net win or not will depend on the user behavior. If the user looks at just 1-2 webpages, then inlining is faster because you save one HTTP request. If the user look as several pages, then external CSS is faster overall, because the external CSS is a separate document which will be cached by the browser (since you're of course serving your CSS with long cache headers).
Find all posts by this user
Quote this message in a reply
01-03-2011, 06:35 PM
Post: #5
RE: With request for html page - send html AND css file
I guess this is the reason that Google does inline CSS? To miss that extra request?
Find all posts by this user
Quote this message in a reply
01-04-2011, 12:49 AM
Post: #6
RE: With request for html page - send html AND css file
(01-03-2011 06:35 PM)Geebee Wrote:  I guess this is the reason that Google does inline CSS? To miss that extra request?

Yes, it is. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)