mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
cache /
This commit is contained in:
parent
d92cd6f3a2
commit
ace0f2030c
3
app.py
3
app.py
@ -4,7 +4,6 @@ from __future__ import division
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import tempfile
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
from flask import Flask, g, jsonify, render_template, request, abort, redirect
|
from flask import Flask, g, jsonify, render_template, request, abort, redirect
|
||||||
@ -15,6 +14,7 @@ app = Flask(__name__)
|
|||||||
try:
|
try:
|
||||||
app.cache = Cache(app, config={'CACHE_TYPE': 'redis'})
|
app.cache = Cache(app, config={'CACHE_TYPE': 'redis'})
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
|
import tempfile
|
||||||
app.cache = Cache(app, config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': tempfile.gettempdir()})
|
app.cache = Cache(app, config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': tempfile.gettempdir()})
|
||||||
|
|
||||||
DATABASE = 'taiko.db'
|
DATABASE = 'taiko.db'
|
||||||
@ -150,6 +150,7 @@ def close_connection(exception):
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
|
@app.cache.cached(timeout=15)
|
||||||
def route_index():
|
def route_index():
|
||||||
version = get_version()
|
version = get_version()
|
||||||
return render_template('index.html', version=version, config=get_config())
|
return render_template('index.html', version=version, config=get_config())
|
||||||
|
Loading…
Reference in New Issue
Block a user