Separating content/footer/header - worth the trouble?
Depending on the design, I've made both separated HTML documents (those with footer.html, header.html, content.html, etc) and single documents with everything 'baked in.'
The separated-approach sometimes makes xHTML compliance difficult, because you can't easily validate a partial document, which usually doesn't have META tags, style declarations, and DOCTYPEs.
However, I do like seperate headers and footers because I feel like I'm being efficient.
But how is that different compared to using Templates in a web-dev program like Dreamweaver? Does it save any bandwidth? When I view a document that is automatically generated from multiple files, aren't I actually downloading the same amount of data that appears in a single 'chubby' HTML document?
Does it save any bandwidth? When I view a document that is automatically generated from multiple files, aren't I actually downloading the same amount of data that appears in a single 'chubby' HTML document?
It doesn't save bandwidth but it doesn't really add any.
The main advantage is to the site programmer (you) because it reduces maintenance requirements. If you have your header/footer in separate files and you decide to change them then you only have to change 1 file to get a site wide change as opposed to having to change every file on the site.
About the bandwidth: Using includes or not makes no difference to bandwidth (you're serving out the same amount of HTML code either way), but the server load with includes can become an issue if your site gets a lot of traffic. I have yet to see it make a huge impact on server load more, as other things tend to drain it out quicker (i.e. unclosed database connections or objects).