Book Image

Learning Flask Framework

Book Image

Learning Flask Framework

Overview of this book

Table of Contents (17 chapters)
Learning Flask Framework
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 that is a static copy of your site and that can be served up by your web server as static content.

This has the added benefit of the site being much more secure since the active version of the site cannot be changed by using the Flask app or the...