Commit f9052ee80da3c7905c9fd9d8e2ffb1dcbf8d848e
1 parent
e81a9130
Exists in
master
barrabrasil.py: corre??o da fonte. build.sh: modifica??o na data. profile.py: adicionando profiling
Showing
5 changed files
with
15 additions
and
15 deletions
Show diff stats
LEIAME
app/barrabrasil.py
| ... | ... | @@ -54,23 +54,11 @@ def barra(): |
| 54 | 54 | resposta = make_response(conteudo) |
| 55 | 55 | resposta.set_etag(etag) |
| 56 | 56 | resposta.headers['Content-type'] = 'application/x-javascript' |
| 57 | - resposta.headers['Cache-control'] = 'public, max-age: 86401' #24 horas | |
| 58 | - resposta.headers['Last-Modified'] = data | |
| 59 | - return resposta | |
| 60 | - | |
| 61 | -@app.route('/static/opensans-bold.woff') | |
| 62 | -def fonte(): | |
| 63 | - f = app.open_resource('profile') | |
| 64 | - cfg = Config(f) | |
| 65 | - data = cfg.date | |
| 66 | - f = app.open_resource('static/opensans-bold.woff') | |
| 67 | - conteudo = f.read().decode('base64') | |
| 68 | - resposta = make_response(conteudo) | |
| 69 | - resposta.headers['Content-type'] = 'application/x-font-woff' | |
| 70 | 57 | resposta.headers['Cache-control'] = 'public, max-age: 31536000' #1 ano |
| 71 | 58 | resposta.headers['Last-Modified'] = data |
| 72 | 59 | return resposta |
| 73 | 60 | |
| 61 | + | |
| 74 | 62 | if __name__ == '__main__': |
| 75 | 63 | import webbrowser |
| 76 | 64 | webbrowser.open("http://127.0.0.1:5000/",new=2) | ... | ... |
app/profile
| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | +#!flask/bin/python | |
| 2 | +from werkzeug.contrib.profiler import ProfilerMiddleware | |
| 3 | +from barrabrasil import app | |
| 4 | + | |
| 5 | +app.config['PROFILE'] = True | |
| 6 | +app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions = [30]) #30 que mais demoraram | |
| 7 | +app.run(debug = True) | ... | ... |
build.sh