Pros and Cons of SSI for dynamic-static delivery

Posted on 2004-11-14
Last Modified: 2012-05-05
We find ourselves gravitating to turning whole sites into foo.shtml pages and putting the load on Apache to build the page from SSI's a  typical example is below,  where (obviously) all elements common to all pages are pulled in just before delivery. Now, we are beginning to do more stuff like this that extends from simple text includes to exec's that drive' CGI's that test the URI and other stuff and return chunks based on lot's of other logic that the CGI works out...

So far this site dev path seems like a walk in the park. In fact our magazine archive site is completely SSI driven top to bottom. The advantages are obvious, instantanious global updates just by editing a few files...the final page *appears* static and is indexable by search engines, as opposed to dBase driven pages which may not be so easily indexed (but, I may be making wrong assumptions about this latter point, as I don't have experience with dbase generated web sites) etc. Of course you know all that...

  Also we find the page load times very fast compared to .asp  or java created sites.   So, before I go turning our other web sites into complete foo.shtml-parsed page sites, I just wanted to air this out here to see if there are downsides that others have actually experienced... I'm not really looking for "opinions' though opinions are also welcome, but hard experience from those who have actually done it, or answered questions of others who have actually done it and can give real life specific "consequences" or "if you go with parsing all the pages... here is what you will face one day..." answers...  So far the CPU speeds on our box and current version of apache seem to have no problems, but then, our user hits per month are not that high, yet.... we get, from webalyzer about 200,000 unique IP's hitting our sites per month... round that down for rotating IP's on a single session it's probably more like 170,000 unique IP's per month, across all sites. so one specific question will be, at what point would parsing all pages start to cause delivery slow down... i.e. the hit rate per minute at which parsing pages starts to choke the CPU? And, if this is an issue at all or not? I'm talking about 80,000 html pages overall... on all sites combined, delivered from the same box., many of which are accessed only infrequently.

<!--#include virtual="/ssi/copyright.txt" -->
<TITLE>Hinduism Today |  Jul 1993</TITLE>
<!--#include virtual="/ssi/article_header.txt" -->

<!--Start article text-->
<!--Current issue date ie. "May/June, 2001"-->
<B>July 1993</B>

<!--Start exported text here-->

      <font size="7">Article Headlines (actual text removed for this post)</font><font size="7"></font>
<p><font size="4">article Text (actual text removed for this post)</FONT>
<div class="localNavLinks">
<!--#exec cgi="/cgi-bin/local_nav_include.cgi" -->

<!--End article text-->
<!-- ======= FOOTER TEXT ======= -->
<!--#include virtual="/ssi/article_footer.txt" -->
<!-- =========================== -->

Question by:Sivakatirswami
    LVL 6

    Expert Comment

    IMHO, sounds like an awful lot of work.  While SSI can save you from writing static code over and over again, SSI itself is still a static technology.  I would suggest learning to use the .net framework, or another dynamic language to rebuild your site, rather than simply compartmentalizing everything in includes.  You shouldn't have any catostrophic problems moving your site to this method, as long as the server understands how to use an include, the obvious drawback is that a single mis-spelling or non-exsistent include file will break the whole page with probably a 501 error.  Sites don't have to be database driven to have dynamic content management.  Recently I've written a content manager that creates a library of XML documents which are parsed as content in some excellent sites.

    Author Comment

    thanks Praesidium

    ".net framework"   where can I find out about this technology?
    LVL 18

    Assisted Solution

    I'd highly suggest PHP over anything microsoft or asp related.  Microsoft is bloatware all around.  PHP is quite zippy out of the box, and multiple free and commercial tools exist to boost performance if that ever proves necessary.

    As for the original question, just about every site you ever see anywhere is dynamically generated.  There is too much going on in a modern site to have enough manpower to do it any other way.  Even if you have to get a server that's twice as powerful, it's a one time purchase and an endless man hour savings.

    Author Comment

    PHP... yes, I'm aware of it.

    Problem is I am a bit stuck in the dark ages... meaning I don't have the background and training to take 1000 pages and turn them into. PHP pages... in fact I wouldn't even know where to begin.. that's not to say, not capable... (i do a lot of programming to generate static web pages,) its just getting from A to J... like I don't even know exactly what "Dynamically generated" means...other than to imagine all the text of your page in an SQL database, which,somehow, feels not the way to go...

     in terms of document type and structure... what do you have lots of text files and PHP puts them together as HTML? Are the generated on call by the browser or you build you site on the weekend and then you have static pages on site until the next build?

    If you look at  you will kind of see where we are at.  This would be the easiest size to port to PHP because it is already pretty much built on the file with ssi wrapper around a single "article file that pulls in the header, footer and side bar navigation.  

    I guess what I'm saying is I need a "building web Sites with PHP for newbies" guide.  Or, in this Q and A context, a two paragraph  over view of "here's how it works" would be great.

    We have our own managed server, space anc speed is not really an issue and a CPU upgrade is in the overall financial picture.


    LVL 8

    Accepted Solution

    There is nothing wrong with SSI and if all you want to do is use a standard header/footer it's more than enough.
    Any scripting language will be a larger hit on the server than SSI is, and possibly more work to convert initially (not to mention the learning curve).

    The one obvious effect of converting static html to ssi is that for every request you double or triple the disk reads and add a little cpu overhead
    - read shtml page. (disk)
    - parse shtml page looking for includes (cpu/mem)
    - read includes (disk)
    - build page (cpu/mem)

    Considering everything else apache has to do (configuration, security, ...) it won't matter that much and it's easily solved by adding a little cheap hardware (mem or disk)
    LVL 5

    Expert Comment


    here u found all about .NET framework. Go for XML web services to fullfill you requirements.

    LVL 6

    Expert Comment

    I see, so you think he should go ahead and use a glorified text processor rather than learn a far more powerful/superior server side language...  Since I know both languages extensively, I'm going to have to go ahead and say that only a fool would set out to learn php in 2004.  In 2001... maybe 2002, anywhere before the release of the v1.1 framework you could possibly have an argument, but at the end of 2004, all I can think is, are you serious?  Maybe you should take the time to learn a real server language, you will be amazed at how much more powerful it is than php.  Seriously, in 2005 the 2.0 framework will be released, and you should seriously consider stepping up to it.

    Sorry it took me so long to reply.  PHP is not a good choice for the future, as I mentioned above here.  To download the .net framework for you server, as well as the SDK go to .  Just like any other languages you'd care to learn, there is a TON of information on the net.  Let me know if I can be of further assistance.

    Author Comment

    OK I will check it out, but i should say at the outset that our "company" himalayan academy publications aka the education division of Saiva Siddhanta Church at Kauai's Hindu Monastery,  have been "mac fanatics" since the day I got my first Apple II in 83... or was that 86?  Of course we have a few PC's for the some accounting purposes...but we don't run any MS software on them other than excel. <begin rant>Suffice it to say we have assidiously avoided any strategy that might get us deeply invested in any Microsoft product. While this may seem like an unreasonable bias, after 20 years in the  biz and having been on the net before it existed (Hinduism Today was posted on the Compu Serve's  bulletin boards before html was ever heard of and one of the first online zines in 1995)  I can say that this strategy has most certainly saved our organization 1000's of man hours and IT grief.  Every time we do get near one of the PC's here for any reason, I know for sure that my productivity will drop by 25%.    I recently tried to recruit some remote staff from India for web content development. They were using FrontPage, inexperienced and 100% invested in the MS tool box to do the job for them,  The resulting code that came back to me was the most horrendous stuff I ever saw in all my html days, and they had no recourse within the scope of  their knowledge and tools to fix it. of course that's what I get for asking college kids to help. but if I ask a person

    Excuse me for the rant... but it will take a lot for us to overcome the gut feeling that getting anywhere near Redmond products will,  in the end, be a regrettable decision.  

    The reason can be summed up in three words: simplicity, clarity and integrity.    Microsoft doesn't know the meaning of those three words in their product line. By integrity I mean software that is not full of "gotcha's" "Oh, gosh, this doesn't really work!" or (Gee why do they do that automatcially, I didn't ask for that! How can I turn that off? (sorry, you can't)"  </rant>

    Of course as happy user of MS products you will think we are nuts, and that would be totally understandable ;-)

    Typically i can accomplish in 20 minutes with revolution's xTalk CGI's what might take other, even experienced, programmers, 1 1/2-3 hours to do in any other language...xTalk has some limitations of course, but so does any language (inability to maintain global variables across a single session through multiple pages being the main one.. easily worked around though,)  if it looks like netFramework will eat production time... it's not an option. I also am responsible for content development and the coordination of remote collaborators.

    But I will  try to look at net.framework with an open mind. Does  netFramework run on Linux?  with netFrameWork... where does the raw data live? small.xml files? in a mySQL data base?


    Author Comment

    OK, we'll settle for SSI for some sites and for our new databased web site we will use a Revolution application server solution  that pulls from  a POSTGreSQL dBase with a single PHP script in the cgi bin, that simply read stnIn from the POST or GET and passes it back to  Revolution.

    Closed for now, thanks for the input.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now