> > 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 >
I assume you mean *models* will be re-executed for each static file request in case #1. To avoid that, perhaps you could add some logic to serve static files at the beginning of the first model file (or create a model file for this purpose that executes first) -- that way, you can serve the static files before any of the models are executed. Anyway, I agree it would be nice to have more control over how static files are served, though as you noted, in production this typically isn't handled by web2py anyway. Anthony

