views:

940

answers:

1

How do I support ETags in ASP.NET MVC?

+6  A: 

ETAG's in MVC is the same as WebForms or HttpHandlers.

You need a way of creating the ETAG value, The best way i have found is using a File MD5 or ShortGuid.

Since .net accepts a string as a ETAG, you can set it easily using

Response.Cache.SetETag("00amyWGct0y_ze4lIsj2Mw");

Video from MIX good video, at the end they use ETAG's with REST

Elijah Glover