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