Re: include facility in html

Jed Hunsaker wrote:
> 
> It would be very useful to be able to embed HTML just like any WAV or
> MIDI file. I know it's already available for JavaScript as a js file
> but I still wonder why not HTML? If I use a footer on every HTML page 
> and I want to edit it, I have to go to each HTML page and edit it one 
> by one.

The current answer to this problem is to use server-side includes or a
server-side language.   Apache, IIS, Netscape, and most any other server
is capable of this.  For some reason this idea has classically been
considered a server issue, and not a HTML issue.  I agree that
standardizing this would make sense.  The problem is that soon after
people start using includes they realize they require the ability to
include different files depending on certain conditions.  Server-side
languages like PERL, PHP, ASP, CF are all capable of conditionally
including files, each using a different syntax.  Really the requirement
is for a standard cross-platform server-side language.  Has the w3c ever
considered standardizing the server-side, or is it just a client based
organization?

There also are issues of speed and efficiency that should be considered
because client-side includes are typically much slower than SSIs.
(except with libraries of common routines stored in the client cache) 
I've included related excerpts from an old email on this subject below.

In the meantime, I suggest everyone check out the wonderful free PHP
server-side language as it is full of features, looks like c, it has
great support from its established user community, and the same code
works well on both UNIX and NT platforms.  (http://www.php.net)  
Oh yeah, it also does includes.  :)

Good Luck, 

--M.

Here's a brief speed/overhead comparison between client-side includes
and server-side includes:

If you use JavaScript to "include" a file the process goes like this:

0)  Someone requests your page by clicking a link or entering the URL.
1)  Host (Server) is found
2)  Browser asks for page from Server
3)  Wait for Browser Request to go over the net
4)  Server sends page to browser
5)  Wait for page to come over net.
6)  Browser parses thru the html and finds javascript include
7)  Host is found again (reasonably quick because now in browser cache)
8)  Browser requests included page from Server
9)  Wait for the request to go back over the web
10) Server sends included file to Browser
11) Wait for include file to come over net
12) Browser stuffs this into the document buffer and keeps parsing html
13) Browser Displays Page

NOTE: Steps 6 thru 12 are repeated for each "included" file that isn't
in the cache.

Now if you use server-side includes or a server-side language it goes
like this:

0)  Someone requests your page by clicking a link or entering the URL.
1)  Host (Server) is found
2)  Browser asks for page from Server
3)  Wait for Browser Request to go over the net
4)  Server parses (processes) page inserting all includes and doing any 
    processing of server-side code.  (PHP, PERL, ASP, etc.)
5)  Server sends resulting page to browser
6)  Wait for file to come over net
7)  Browser Displays Page

Received on Friday, 28 August 1998 09:26:03 UTC