hello everybody... For w2p_tvseries I'd like to set an expire header for banners etc. Usually my apps where behind a real webserver, so with rewrite rules one can always intercept /static/ requests and don't pass them along to web2py.
For w2p_tvseries, though, I think that for the 70% of the time the app will be fired when requested and shut down, as a desktop app, so users will benefit from rocket only. Web2py is a little conservative on that matter: I know that between requests a file could change so it is better always to check it for modifications but hey, the 99% of the time the static folder remains the same for a loooong time. I see 2 options with current web2py: 1) move static files to uploads, tune up the standard download function and add an expire header there 2) create another supersmall app without models, only one controller serving images with response.stream and adding the expire header 1 is bad because modules will be reloaded each time for the relatively stupid image serving, 2 is bad because there will be 2 app to install to web2py to make 1 worth using :D Is anyone came up with a solution ? it would be wonderful if with routes for a particular folder one could add a header to tune up a little bit the standards ... BTW: I'm thinking about setting an expire header of 1 hour to the static folder, it could mean for subsequent requests something like 50 less requests for loading a page. I know that web2py's stream_file_or_304_or_206 is smart enough to return a 304, but it's an occupied thread nonetheless os.stating() a file. BTW2 : no flame wars on "it's bad to set expire headers in the future". We can use cache() to fine-tune many things planning carefully the "timeout", but not static files, think this as another use of cache ;-)