|
|
 |
Server-Side Includes Overview
Server-side includes (SSI) are used to insert the contents of another
file anywhere onto a Web page at the time the Web page is accessed
by the visitor. Using SSI is very similar to using library items
in Dreamweaver in the sense that they serve as a central location
for storing and editing objects that are reused frequently on your
site. Think of SSI as a web server utility that inserts a "library
item" when the page is accessed by a visitor instead of saving
and updating library items in Dreamweaver.
You may be wondering: if using SSI is so similar to using library
items, and because library items are already so easy to use, why
would anyone bother using SSI? To answer this question, let's look
at an example:
- Your department publishes approximately a dozen news stories
on your Web site each month. Each page uses Dreamweaver library
items to include a navigation menu that links to the three most
recent news stories.
- Each time you update the Recent News menu, you make the editing
changes on your master library item, then allow Dreamweaver to
update all the pages on your site that use that library item,
and then you synchronize your site to upload the revised pages.
- In a year's time, if you use the Recent News menu library item
on all your news pages, Dreamweaver will need to revise over 100
pages every time you update the library item. In 3 year's time,
that number will exceed 400 pages that will need to be updated
and uploaded every time you make a change to your Recent News
menu.
Now let's look at the same scenario using SSI instead of Dreamweaver
library items:
- You maintain your Recent News menu as a separate file on the
server and use SSI to include that file within your page every
time a visitor accesses that page.
- Each time you update the Recent News menu, you edit your SSI
file and upload only the SSI file to the server.
- When your news archive grows to 400 pages or more, you still
only need to edit and upload ONE file when you make a change to
your Recent News menu.
As you can see, SSI is an attractive alternative to library items
when 1) you expect to be reusing an item on many, many pages; and
2) your item will be frequently changing.
|