Creating secure, stable versions of your site by creating static content

One technique for a high-volume site with low-dynamic content is to create a site that is simply a static copy of the dynamic site. This works great for blogs as the content is generally static and updated, at the most, a couple of times a day. However, you are still doing a bunch of database calls and template renderings for the content that effectively doesn't change.

And, of course, there is a Flask extension that has this covered: Frozen-Flask. Frozen-Flask identifies the URLs in your Flask app and generates the content that should be there.

So, for the pages it generates the HTML and, for static content such as JavaScript and images, it pulls them out into a base directory ...

Get Learning Flask Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.