简体   繁体   中英

mod_wsgi items saved in wrong order

I am trying to get a grip on mod_wsgi by writing a simple WSGI server running under Apache on Linux. However I notice that requests are not always served in the order in which they arrive, even if they come from the same client/browser.

If a page eg contains images A and B respectively, A may be served as answer to the request for B, so it is shown at the wrong place. I'm convinced I must be making a very trivial mistake, but I am unable to find out what.

I am aware that the WSGI callable must be reentrant, and by logging requests and responses, I see that indeed it is sometimes entered a second time before the first result is served. But surely when the browser asks for B it should not get A as result from a previous GET. Or am I missing something very fundamental about HTTP?

Global Apache directives:

LoadModule wsgi_module /home/sterlicht/modWsgi/mod_wsgi.so

Virtual host directives:

WSGIScriptAlias / /home/sterlicht/debug/app.py

Found out what was wrong. My callable was not reentrant after all. The code in the call member of my application class used some instance data, which were overwritten by concurrent invocations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM