Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other PHP Include vs CodeKit Include: significant performance benefit?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #152263
    Michael Sheaver
    Participant

    I am setting up a new website which will consist (at least initially) of mostly static pages. Being a programmer and software engineer by training, I am very keen on making my code as modular as possible. I have placed the HTML for each section of the page into separate files, such as header, nav, sidebar, main-content, footer, etc. I had planned to use the PHP include statement to bring all of these elements together on page load-up. However, I recently discovered that CodeKit has the ability to use @includes to generate the complete HTML file at compile time, thus eliminating the need for multiple server-side PHP calls.

    I have several questions that I would like to pose regarding this: 1. Would the CokeKit approach make a big difference in page download performance, or is the time saving negligible? 2. Are there other tried-and-tested ways of keeping the HTML code modular? 3. If I were to use the CodeKit approach, is there a non-PHP way to do this: © 2012-<?php echo date(‘Y’); I bring these questions here in the hopes of tapping into the great wisdom of others who may have dealt with this kind of stuff.

    #152561
    petetak
    Participant

    Hi Michael,

    Codekit outputs to one flat html file which will always be faster when running on the server – although a user would probably never notice the difference.

    I’m one of the developers on Mixture.io and we use Liquid templating to keep projects modular – I would highly recommend this approach (but I would of course!)

    The date problem can be easily solved with Liquid – check out the date section in our docs: http://docs.mixture.io/templates (see Output / The date filter section)

    Thanks
    Pete

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.