SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Iframe Question

  1. #1
    SitePoint Member
    Join Date
    May 2005
    0 Post(s)
    0 Thread(s)

    Question Iframe Question

    HI All

    I have a large number of web pages that are dynamic
    but a section in the middle that is the same for everyone
    of the pages, it is a large amount of mixed content, images,text ,css,form elements.

    THese pages are being developed in php

    my question is, if this content is the same and never changes,
    can i put them in another html file and include in an Iframe
    so that they are not processed aspart of the php ( not much of a benefit with cacheing etc) on the server but more importantly cached at the client end so not downloaded and hopefully saved network traffic?
    will this work?
    is there a better way of doing this?
    will there be any benefit?
    I am hoping that when they go from page to page, the clients browser will not need to re download the content for the iframe each time
    THanks in advance

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    0 Post(s)
    0 Thread(s)
    I wouldn't use an <iframe>. If you use external stylesheets and unobstusive, external scripts, then there won't be much X/HTML code to send and text doesn't use much bandwidth anyway.

    You could just use a PHP include() and make the included file be a plain ".html", if you don't need it to be parsed by the PHP parser.

    Why Frames Are Bad
    Why Frames Suck (Most of the Time)(1996)
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Evangelist sputza's Avatar
    Join Date
    Jan 2002
    0 Post(s)
    0 Thread(s)
    Iframes are on the way out and are being replaced with the scrolling div. I think there is no reason to use the iframe. The bandwidth saved would be little if its just an html file that is in that iframe.

    I would just use PHP include() or other built in features of PHP such as include_once(), require(), require_once(). I would stay away from the php require() function for one main reason: if the requred file is not found the page will not continue to load.
    Steven Watkins
    Chief Web Ninja
    Code Monkey Interactive


Posting Permissions

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