[Web-SIG] Other kinds of environment variables

Ian Bicking ianb at colorstudy.com
Fri Aug 27 06:34:17 CEST 2004


Mark Nottingham wrote:
> On Aug 26, 2004, at 5:03 PM, Ian Bicking wrote:
> 
>>> * cache validation - does the server handle If-Modified-Since and 
>>> If-None-Match requests appropriately (e.g., with a 304)?
>>
>>
>> I would almost certainly expect this to be false.  There may be some 
>> WSGI servers that have an extended notion of the application, so they 
>> can look at things like the modification date.  But those are likely 
>> to be uncommon -- more likely only applications will know the 
>> necessary information.
> 
> 
> Apache CGI does it; i.e., if you set a Last-Modified header, it'll 
> automagically handle validation for you.

That seems... well, Apache is putting forward effort, but obviously it's 
not a terribly efficient way to go about it.  I think it would be fine 
if a server did that when it could, but I wouldn't leave it up to the 
server if the application was able to handle it on its own.  So it's not 
particularly important for the application to know if the server is 
going to do this, as it wouldn't change what the application does.  (So 
long as the application is giving an accurate Last-Modified header, 
which I think we should expect.)

But this made me think, the WSGI spec leaves lots of ways for the server 
to add extensions to the request, but not many ways to extend the 
application.  Presumably if you wanted the server to be able to handle 
this, the server would have to be able to query the application in some way.

In this case it would be sufficient to have the server implicitly query 
the application by looking at the headers it produces.  From there, it 
would want to abort the application (though it might be reasonable for 
the application to refuse to be aborted).  There's no allowance for 
this, nor can I think of an extension to allow it.

This is where application starts to blend into resource, which isn't the 
way WSGI looks at things (reasonably, since resources are much more 
complex and full of structure compared to applications).  As I think 
about it, I'm kind of talking myself out of the whole thing... but there 
are places where middleware could make good use by looking ahead into 
the application, but I don't think WSGI could be extended in that direction.

-- 
Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org


More information about the Web-SIG mailing list