1w6 uRPG 1w6 uRPG
  • Anmelden
  • Öffentlich

    • Öffentlich
    • Gruppen
    • Beliebt
    • Verzeichnis

http://sn.1w6.org/file/sl-20151121T051104-znnqqcy.html

http://sn.1w6.org/file/sl-20151121T051104-znnqqcy.html
Found a few interesting issue with Bottle and it's static file serving. Setting headers for static file server has to be done differently than with every other type, where returned data is automatically rendered into response. Example:
r = static_file(filename, root='path')
r.headers['Cache-Control'] = 'no-cache' # Or something similar, whatever value is preferred
return r
if you do it like it was in some documentation
response.headers['Cache-Control'] = 'public, max-age=86400' # As for other than static types
return static_file(filename, root='path')
This leads to situation where the Cache-Control value isn't actually included in the response.
This could potentially be huge fail on a busy site or with CDN.

!python #bottle #website #programming #softwaredevelopment #webframework

Nachrichten, in denen dieser Anhang erscheint

  1. sl sl

    Found a few interesting issue with Bottle and it's static file serving. Setting headers for static file server has to be done differently than with every other type, where returned data is automatically rendered into response. Example: r …

    Saturday, 21-Nov-15 05:10:55 UTC
  • Hilfe
  • Über
  • FAQ
  • AGB
  • Privatsphäre
  • Quellcode
  • Version
  • Kontakt

1w6 uRPG ist ein Mikrobloggingdienst von Arne (Drak) Babenhauserheide. Es wird mit der Mikrobloggingsoftware StatusNet (Version 1.1.1-release) betrieben, die unter der GNU Affero General Public License erhältlich ist. The running version includes the patches from draketo.de/proj/statusnet-patches.

Creative Commons Attribution 3.0 Alle Inhalte und Daten von 1w6 uRPG sind unter der Creative Commons Attribution 3.0 Lizenz verfügbar.