Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etags support #52

Open
cainus opened this issue Jan 2, 2013 · 1 comment
Open

etags support #52

cainus opened this issue Jan 2, 2013 · 1 comment

Comments

@cainus
Copy link
Owner

cainus commented Jan 2, 2013

add etags support. (to simple resources and CRUDCollection)

If an etag($) function is defined...

  • GETs return the etag($) return value in the ETag header as a quoted string.
  • If the client sends an If-Match header that matches it, then PUTs and DELETEs should be allowed to succeed, otherwise a 412 response (Precondition Failed) should be sent.
  • If the client sends an If-None-Match header that matches it, then GETs should return a 304 (Not Modified) response.

If fetch($) is defined for a resource, the etag($) function should be executed AFTER fetch($) so that $.fetched is available to the etag($) function.

@cainus
Copy link
Owner Author

cainus commented Jan 13, 2013

I just realized that the interface must optionally include the full body of the response, in case the etag depends on it (eg it's a hash of the body). If the etag() function definition only takes $, it could be calculated without the body though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant