SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    Minnesota/America
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

    What are your thoughts?

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Validate your generated pages rather than each individual piece. I use includes for headers/footers/menus and my site validates. I just run it through the validator when my pages are online.

  3. #3
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by creativearc
    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.

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    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).

  5. #5
    SitePoint Addict shrikie's Avatar
    Join Date
    Dec 2002
    Location
    Hyperion
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it kinda depends on the size of your site, the bigger, the more it's worth of doing the hassle


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •