title: How to set eTag header from jQuery?
body: <p>I am developing a Single page app, and I have a lot of requests to the server. There is one really big response(like 20-30 kb), and this response changes once every week, and I would like to cache the response in the browser based on an eTag. The ETag is set correctly from the server, but the browser doesn't send the eTag back on the next request.</p>
  
  <p>Here is my server code :</p>
  
  <pre><code>public string GetActiveConfiguration()
      {
          var requestedETag = Request.Headers["If-None-Match"];
          var responseETag = layoutRepository.GetActiveConfigurationVersion().ToString();
          if (requestedETag == responseETag)
          {
              Response.StatusCode = 304;
              return "";
          }
          Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate);
          Response.Cache.SetETag(responseETag);
          return layoutRepository.GetActiveConfiguration();
      }
  </code></pre>
  
  <p>Here is my client code :</p>
  
  <pre><code>$.ajax({
              url: 'Admin/GetActiveConfiguration',
              type : 'GET',
              ifModified: true,
              success: function (data) {
                  that.configuration = $.parseJSON(data);
                  that.setRoles();
                  that.setTitleAndIcon();
                  that.initializeChat();
                  callback();
                  //that.loadViews(Object.keys(window.params)[0]);
              }
          });
  </code></pre>
  
  <p>Here is the server response :</p>
  
  <blockquote>
    <p>Cache-Control:private
    Content-Encoding:gzip
    Content-Length:6544
    Content-Type:text/html; charset=utf-8
    Date:Tue, 13 May 2014 14:19:52 GMT
    <strong>ETag:13.05.2014 17:01:02</strong>
    Server:Microsoft-IIS/8.0
    Vary:Accept-Encoding
    X-AspNet-Version:4.0.30319
    X-AspNetMvc-Version:4.0
    X-Powered-By:ASP.NET
    X-SourceFiles:=?UTF-8?B?QzpcUHJvamVjdHNcZUNvbW1lcmNlXE1pY3JvaW52ZXN0IGVDb21tZXJjZSBQcm8gTmV3XE1pY3JvaW52ZXN0IGVDb21tZXJjZSBQcm8gTmV3XEFkbWluXEdldEFjdGl2ZUNvbmZpZ3VyYXRpb24=?=</p>
  </blockquote>
  
  <p>Here is the next client request :</p>
  
  <blockquote>
    <p>Accept:<em>/</em>
    Accept-Encoding:gzip,deflate,sdch
    Accept-Language:en-GB,en;q=0.8
    Cache-Control:no-cache
    Connection:keep-alive
    Cookie:I'llhideThoseOnPurpose:)
    Host:localhost:61061
    Pragma:no-cache
    Referer:localhost
    User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
    X-Requested-With:XMLHttpRequest</p>
  </blockquote>
  
  <p>What am I doing wrong ?</p>