limbo

msg:4053681 | 12:04 pm on Jan 4, 2010 (gmt 0) |
There's no need to apply it to each include. Just place this: <link rel="stylesheet" type="text/css" href="/css/master.css"> in your pages <head></head>. As includes are rendered on the server, before the CSS is applied, there is no real point in adding it inline as well. Lucky for you it's a quick change to each include, not to dozens of pages :)
|
doob

msg:4057197 | 6:55 am on Jan 9, 2010 (gmt 0) |
1) The reason I like having the css attached to each include is so I can preview the styling of each module independent of an index page. Its very helpful to catch errors and troubleshoot as well. 2) my real concern is that the css file that each of the 20 includes that make up a page references is being read in by the browser 20 times. So onload is the browser reading and caching the first instance and ignoring the additional 19 calls or is it reloading it and comparing the file 20 times for a single page load? Thanks!
|
limbo

msg:4057247 | 9:35 am on Jan 9, 2010 (gmt 0) |
One load (then cache). Just 19 extraneous lines of code. I'd create a test page with the css file in the head, and load the php includes into it. I think it definitely makes sense to remove each call from the 'live' includes - it's doing you no favors :)
|
doob

msg:4061655 | 8:59 pm on Jan 15, 2010 (gmt 0) |
Thanks limbo. And its still going to be 1 load then cache for all browsers? If that's the case then its probably not worth the work right now just to save on 19 lines of code. Just wanted to make sure that it wouldn't be resulting in 19 extra http requests! -D
|
Drag_Racer

msg:4062645 | 5:28 am on Jan 18, 2010 (gmt 0) |
Even though it does not download the stylesheet more than once (if it is cached), the browser will still parse the file, hence slowing down the page. Just something to keep in mind...
|
|