Skip to content

Instantly share code, notes, and snippets.

@zeekay
Created November 6, 2011 14:43
Show Gist options
  • Save zeekay/1342973 to your computer and use it in GitHub Desktop.
Save zeekay/1342973 to your computer and use it in GitHub Desktop.
CACHE_DIR = 'static'
def cache_routes(app):
for route in app.routes:
path = os.path.join(CACHE_DIR, route.rule[1:])
os.mkdir(path)
with open(os.path.join(path, 'index.html'), 'w') as html:
html.write(route.call())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment