Interacting with a DB is very helpfull if you have information that changes very often or is displayed depending on the client.
OK, if you have lets say technical documentation for 50 tools and you store those in your DB and all clients shall get the same information then it would be waste of server power to let it generate documents on each request.
Even your server might cache the results of these queries the documents would be generated more often than it needs to be done.
Therefore I suggest the following:
Create somewhat like an admin script to compare the mod date of your generated files with an field in your DB holding the date or better timestamp when the info in that datafield changed. If the document you have is older than the info, the document should be deleted and newly be generated with the new info (thats easier than changing that document).
If you don't want to invoke that script manually you could tell your scripts that modify the data in your DB to check if the data changed will effect your documents and if it should invoke the update script (or function or procedure if you like to work with objects here).
And you could also perform another check (here might be better to use a cronjob) to look up templates you use to generate your documents from, cause if these changed, you'll have to let all documents be done again.
For example:
,---------------------. | header | `---------------------´ |m | | |e | tooldoc_31 | |n | | |u | | `---------------------´ | footer | `---------------------´
This is quite easy for you if your server does support Server Side Includes (SSI).
eg.: <!--#include virtual="/includes/general/header.inc"-->
But be aware that the result of this must be an valid HTML or XML document (or whatever mime-type) you want to send to the clients browser.
This is only an example for a dir structure:
httpd/ | . . `-static/ | `-help/ | `-about/ `-dynamic/ | `-toolviews/ (so here could go the generated content) | `-menus/ (they might change with your content) `-includes/ | `-general/ (e.g. header, footer, and stuff that occurs very often) | `-menus/ `-templates/ | `-section_a/ | `-section_b/ . .

Have a nice day
All decision is left to your taste

In reply to Re: Technique Efficiancy by little
in thread Technique Efficiancy by Monolith-0

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.