NancyFx/Nancy — pull request #557 by prabirshrestha (2012-03-16 00:58:09+00:00)
Title: extension for including ETag in responses

Adds ETag header if it does not exist. If it already exists, it does not modify the existing ETag header value.

```csharp
using Nancy.Caching;

public SampleModule()
{
this.IncludeETag();
Get["/"] = x => Response.AsJson(new { name = "Nancy" });
}
```

ETag value is generated using the md5 hash of the response body.

Pull request for #183

It is meant to go with pull request #547 (Conditional e-tags).

```csharp
public SampleModule()
{
this.CheckForIfNonMatch();
this.IncludeETag();
Get["/"] = x => Response.AsJson(new { name = "Nancy" });
}
```

This sample would return 304 not modified without the body if etag matches and will also always include the ETag header in the response.