Ben Bangert wrote: > As I'm working on some tools to facilitate the easy use and > distribution of WSGI apps and middleware, a problem is starting to > crop up. Most of these WSGI apps come with their own little set of > static files (images, javascript, etc.) that need to be delivered > should they be executed. Of course, Apache and such only allow for a > single doc-root so I can't exactly through in each WSGI app's path to > the static files. > > These static paths are also very deep as the WSGI apps are installed > as Python egg's. I've been using Ian's StaticURLParser from Python > Paste, but its speed concerns me plus the fact that it means my > webapp is essentially doing little more than relay filesystem data. > > Several thoughts occur to me to deal with this: > > 1) Have a faster version of StaticURLParser, perhaps written in C > 2) Create some sort of specification for a single static docroot > where each WSGI egg gets its own symlink into
I've thought about this too. I think a little of both is best -- have some configurable location where files can be dumped (using Package/Version/) and a URL that goes with that. Then I figure the application, on first startup, will either copy or symlink files into that location -- though sometimes the user the application runs as couldn't do that, so maybe there should be a way to make it happen separately from running the application. In fact, maybe it could simply be some seperate piece of metadata, so the application doesn't have to do it at all. Then the app should generate all the URLs based on that configured static location, or if no location has been configured it should fall back on StaticURLParser. The fallback is useful, especially in a situation like a standalone HTTP server where there isn't any static serving (or at least none that is particularly better than StaticURLParser). -- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org _______________________________________________ Web-SIG mailing list [email protected] Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com
