title: HttpCacheability.Server - Web Handler
body: <p>I am trying to cache a web handler that outputs javascript, the problem is in my web solution the server is not cache, but it does cache in a prototype project. Is there something like security or anything else that may force a call to executable code and not serve server cache back to the client?</p>
  
  <p>This is what I am using, like I said this works fine in a prototype solution so it must be environmental:</p>
  
  <pre><code>        TimeSpan freshness = new TimeSpan(24, 0, 00);
          DateTime now = DateTime.Now;
  
          currentContext.Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
          currentContext.Response.Cache.SetCacheability(HttpCacheability.Server);
          currentContext.Response.Cache.SetValidUntilExpires(true);
  
  
          currentContext.Response.ContentType = JAVASCRIPT_CONTENT_TYPE;
          currentContext.Response.Write(DateTime.Now.Ticks.ToString());
  </code></pre>