Currently I am using <Link Rel.....> but I was wondering if I might gain
some speed using #include to include the whole file in the page before it is
send to the browser. (the page is heavily used - over 100 000 a month)
The similar question could be asked probably about Javascript files...
Does anybody did any testing or knows where to find an answer?
Thanks
MJ
http://www.aspfaq.com/show.asp?id=2092
http://www.aspfaq.com/show.asp?id=2139
"MJ" <skl...@hotmail.com> wrote in message
news:uD0XgtbpBHA.1856@tkmsftngp04...
Scott
"MJ" <skl...@hotmail.com> wrote in message
news:uD0XgtbpBHA.1856@tkmsftngp04...
I don't think it's that clear-cut. With the LINK tag, the browser has to
make a second request to the server. Which, in some cases (most noticeably
with lower-speed dialups), is significantly slower than receiving all the
bytes in the stream of one request. Also, the browser won't necessarily
cache the files, depending on the user's individual settings.
True, there will be an overhead on the initial request, but when the CSS is
common to many files, it can (and will) be cached by browsers and
intermediary caches, meaning the origin server need not be contacted again.
Example:
http://www.didcot.com/ - 18k without CSS
http://www.didcot.com/styles.css - 7k of CSS
I then browse to, say, http://www.didcot.com/eatndrink/ 5k of doc needs to
be requested, but the 7k of CSS is already here.
The HTTP overhead is in the order of less than 1k per request (significantly
less in most cases)
To use the same worked example but with CSS inline:
http://www.didcot.com/ - would be 25k
http://www.didcot.com/eatndrink/ - would be 12k
Or to put it another way, 7k more (before HTTP overhead, which, as we
already said, would be less than a k)
There may be some users who have changed from the default setting of their
browser to always fetch the latest version; but even those can be twarted by
intermediary caches.
In short, it's better for the web server to do them separatly, than together
all the time.
There are other issues, but most of them vanish into obscurity compared to
the size of the data. (like CPU overhead of including the file server side)