Commit 7a137184e0ad3d140c272164bdc385898d6884b8
1 parent
4eaff86c
Exists in
master
barrabrasil.py: cache de 24 horas e adicionado tratamento para a fonte. barra-co…
…pa.scss: mudan?a para a fonte local. Adicionado arquivo de teste para curl.
Showing
3 changed files
with
27 additions
and
3 deletions
Show diff stats
app/barrabrasil.py
@@ -48,13 +48,24 @@ def barra(): | @@ -48,13 +48,24 @@ def barra(): | ||
48 | resposta = make_response(conteudo) | 48 | resposta = make_response(conteudo) |
49 | resposta.set_etag(etag) | 49 | resposta.set_etag(etag) |
50 | resposta.headers['Content-type'] = 'application/javascript' | 50 | resposta.headers['Content-type'] = 'application/javascript' |
51 | - resposta.headers['Cache-control'] = 'max-age: 43200' #12 horas | 51 | + resposta.headers['Cache-control'] = 'max-age: 86400' #24 horas |
52 | + resposta.headers['Last-Modified'] = 'Mon, 30 Sep 2013 19:08:30 GMT' | ||
53 | + return resposta | ||
54 | + | ||
55 | +@app.route('/static/opensans-bold.woff') | ||
56 | +def fonte(): | ||
57 | + f = app.open_resource('static/opensans-bold.woff') | ||
58 | + conteudo = f.read().decode('base64') | ||
59 | + resposta = make_response(conteudo) | ||
60 | + resposta.headers['Content-type'] = 'application/x-font-woff' | ||
61 | + resposta.headers['Cache-control'] = 'max-age: 86400' #24 horas | ||
62 | + resposta.headers['Last-Modified'] = 'Mon, 30 Sep 2013 19:08:30 GMT' | ||
52 | return resposta | 63 | return resposta |
53 | 64 | ||
54 | if __name__ == '__main__': | 65 | if __name__ == '__main__': |
55 | import webbrowser | 66 | import webbrowser |
56 | webbrowser.open("http://127.0.0.1:5000/",new=2) | 67 | webbrowser.open("http://127.0.0.1:5000/",new=2) |
57 | - app.run(debug=False) | 68 | + app.run(debug=True) |
58 | #webbrowser.open("https://127.0.0.1:5000/",new=2) | 69 | #webbrowser.open("https://127.0.0.1:5000/",new=2) |
59 | #app.run(debug=False,ssl_context=ctx) | 70 | #app.run(debug=False,ssl_context=ctx) |
60 | 71 |
recipes/copa2014/assets/barra-copa.scss
@@ -29,7 +29,7 @@ $widthPadrao: 960px; | @@ -29,7 +29,7 @@ $widthPadrao: 960px; | ||
29 | font-family: "Open Sans"; | 29 | font-family: "Open Sans"; |
30 | font-style: normal; | 30 | font-style: normal; |
31 | font-weight: 700; | 31 | font-weight: 700; |
32 | - src: local("Open Sans Bold"), local("OpenSans-Bold"), url("//barra.brasil.gov.br/static/opensans-bold.woff") format("woff"); | 32 | + src: local("Open Sans Bold"), local("OpenSans-Bold"), url("/static/opensans-bold.woff") format("woff"); |
33 | } | 33 | } |
34 | 34 | ||
35 | 35 |
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +\n | ||
2 | +Comando: curl -w "@curl_time_total.txt" -o /dev/null -s http://barra.brasil.gov.br/barra.js > resultado.txt\n | ||
3 | +\n | ||
4 | + size_download: %{size_download} bytes\n | ||
5 | + time_namelookup: %{time_namelookup} segundos\n | ||
6 | + time_connect: %{time_connect} segundos\n | ||
7 | + time_appconnect: %{time_appconnect} segundos\n | ||
8 | + time_pretransfer: %{time_pretransfer} segundos\n | ||
9 | + time_redirect: %{time_redirect} segundos\n | ||
10 | + time_starttransfer: %{time_starttransfer} segundos\n | ||
11 | + ----------\n | ||
12 | + time_total: %{time_total} segundos\n | ||
13 | +\n |