www.webdeveloper.com
Results 1 to 4 of 4

Thread: page loading speed/include files that contain content for every page (headers etc)

  1. #1
    Join Date
    Nov 2006
    Posts
    64

    Lightbulb page loading speed/include files that contain content for every page (headers etc)

    This may be a bit of an obvious question, but I still thought it was worth asking. I am building a fairly complicated site with a lot of includes.

    In terms of content that needs to be on every page, is it actually faster to use include files (I know it is better for maintenance). I am wondering if anyone knows (for sure) if browsers cache include files. So for example page looks like this:

    PAGE 1:
    <include "includes/phpFunctionsNeededOnAllPages.php">
    <include "header.htm">
    <include "includes/menu.htm">
    <p>individual body content for page 1</p>
    <include "includes/footer.htm">


    PAGE 2:
    <include "includes/phpFunctionsNeededOnAllPages.php">
    <include "header.htm">
    <include "includes/menu.htm">
    <p>individual body content for page 2</p>
    <include "includes/footer.htm">

    Does the browser cache the data in all of the include files? So when the next page is loaded, it doesn't have to check or reload the phpFunctions/header/menu/footer and just loads that pages body content? Does it cache the include files these the same way it would cache any other set of html pages?
    Hey, I like potatoes!
    Support the wwf org!

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    The include files are never sent to the browser. They are parsed and sent as html +media.

    The JavaScript, linked css files and media files are normally cached.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Nov 2006
    Posts
    64
    Hmmm, that sucks. Seems like an inefficient way of the browsers processing websites. But I guess since the includes are server side, the browser doesn't necessarily even know they are includes. Other then using virtual frames or actual frames I assume there is no way to work around this hey?
    Hey, I like potatoes!
    Support the wwf org!

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    No, includes are server-side
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles