Generator, new structure, etc

Is it possible to render the header and footer once, and use the resulting strings for each call to render?