Msg#: 4053149 posted 7:20 am on Jan 3, 2010 (gmt 0)
Hi. My site uses a template that uses php includes to create a navbar, mainbar, side column and footer. I then also use php includes in each of those to reference particular widgets or content. I.e the sidebar might use an includes to incorporate commercial ads, sponsorships, alerts and navigation. So just for the sidebar I'd including 4 documents. Each of those 4 documents has a line: <link rel="stylesheet" type="text/css" href="/css/master.css">
Then the sidebar.php file might also have the line: <link rel="stylesheet" type="text/css" href="/css/master.css">
The homepage which uses a php inclues to suck in the sidebar.php will also have the line: <link rel="stylesheet" type="text/css" href="/css/master.css">
So when I read the source for my page from a browser I see sometimes dozens of references to loading master.css.
Is this a problem? Will these multiple reads slow the page down significantly? Is it worth the agravation of devising a method of recoding the whole site to remove this issue? I like having the css in each document for testing.
Msg#: 4053149 posted 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?