iay / mdq-server

Metadata Query Protocol server implementation using Shibboleth MDA
6 stars 6 forks source link

adding Last-Modified response header to mdq-server #11

Open trscavo opened 10 years ago

trscavo commented 10 years ago

I know the spec doesn't require a Last-Modified header but the response would be more readable (by humans) if it had one. Can one be added?

iay commented 9 years ago

Need to work out whether Last-Modified should refer to:

It looks to me as if RFC 7232 requires the latter, by indicating that:

The "Last-Modified" header field in a response provides a timestamp
indicating the date and time at which the origin server believes the
selected representation was last modified, as determined at the
conclusion of handling the request.

Also, in RFC 7231:

In responses to safe requests, validator
fields describe the selected representation chosen by the origin
server while handling the response.

As the representation may change from render to render of the "same" metadata, it seems we need to be conservative about this. Of course it would be nice to be able to push the Last-Modified date backwards to the last time the underlying metadata had changed (within limits) but a lot more work would need to be done in the caching layers to achieve that.