Help - Search - Members - Calendar
Full Version: Why embed the CSS in the HTML?
Hydrogenaudio Forums > Hydrogenaudio Forum > Site Related Discussion
Jasper
As far as I can tell every html file I retrieve from HydrogenAudio comes with 8KB of CSS. Why is this embedded in the HTML? Wouldn't it be quite a bit more efficient to put it in separate file and link to it with <link rel="stylesheet" href="somefile.css" type="text/css">?
Jan S.
Perhaps it would be better to direct this question at Invision Power Board®.
Jurg98
Don't think it makes a difference... When you link to an external stylesheet, you have to read the file anyway, so "bandwith-wise" it's the same...

But as Jan S. states, it's probably related to the board code... Can't do much about it, me thinks... smile.gif
dzy
it's not true, after first loading css will then be cached if server gives the ccs a good expire time
the loading is like this for 5 pages
embed together
(html + css), (html + css), (html + css), (html + css), (html + css)
separate html and css
(html) + (css), (html), (html), (html), (html)

you save 4x css size's traffic
Jurg98
Which in turn depends on your browser of course... And whether you use caching or not, and how often the browser checks the cache...

Right? smile.gif
Sebastian Mares
Invision Power Board gives you the ability to use external CSS.

Admin CP --> Skins & Templates --> Manage Skin Sets --> Edit --> Use Stylesheet --> External
Go2Null
I'd add my vote to being as effecient as possible - use the linked CSS. If the end user wants tobe ineffecient, then so be it, but at least let the server be as effecient.
Jebus
QUOTE(Jurg98 @ May 11 2004, 02:30 AM)
Which in turn depends on your browser of course... And whether you use caching or not, and how often the browser checks the cache...

Right? smile.gif

all browsers at least cache pages from the current session, even if they throw them out on close. If they didn't, hitting the BACK button for instance would force a reload of all the images. It is an extremely good idea to use a single external stylesheet for bandwidth reasons. It's also easier from a site admin point of view (since you only need to maintain one document).

I'm a hardcore CSS and XHTML compliance nut...
WarBird
QUOTE
all browsers at least cache pages from the current session, even if they throw them out on close. If they didn't, hitting the BACK button for instance would force a reload of all the images.


Opera doen't cache at all when you turn it off, so you actually have to reload everything if you hit the 'back' button with cache off. I don't see why anyone would turn it off though smile.gif
xmixahlx
...or use opera, for that matter


anyways, external css is always a good thing

who wants to edit multiple css entries? boooo


later
Dibrom
The external CSS option has been used in the past, and probably will be again once I make the server move. The reason it's not being used now relates to some of the custom modifications we are running on the board which cause problems with this option.
Jasper
Currently each page begins with about 22KB of CSS, that's quite a substantial amount. I'm on ADSL currently, so I don't experience any slowdowns myself (it probably takes more time to render the page than it takes to download it), but it seems like an awful waste of bandwidth to me. So perhaps it's time to turn on external stylesheets if at all possible.
ssamadhi97
QUOTE(Jasper @ Nov 15 2004, 03:56 PM)
Currently each page begins with about 22KB of CSS, that's quite a substantial amount.
*

fyi, the embedded stylesheet actually makes a differenec of ~4.6KB in the page as delivered by the server.
Jasper
QUOTE
fyi, the embedded stylesheet actually makes a differenec of ~4.6KB in the page as delivered by the server.
I understand it might not be a huge load for the viewer (I assume the server can send the pages in compressed form), but it's still a substantial percentage of the traffic. If it's difficult to set up and it's giving no problems on either the client or server side (in terms of load time or bandwidth usage), then I can understand the CSS is inlined, but if it's reasonably easy to set up then why not do it?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.