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