Dynamic web page generation is optimized by reducing the processing
overhead required to parse the web page HTML code for tokens and insert
dynamic content. Using the invention, an HTML file for a dynamic web page
need be read and parsed only once throughout the life of the server. A
software object parses the HTML, decomposes the page into constituent
pieces and saves them to data structures as byte streams, which are
cached, along with the software object, rendering multiple disk accesses
unnecessary when the page is reconstituted. For subsequent requests, the
dynamic page is created from the cached version, which is shareable
across users and across requests. The optimization reduces server
resource usage for dynamic page generation to near zero. The invention is
also applicable to other documents combining static and dynamic content
that require composition tools for editing.