I'm generating my cache manifest on the fly in a handler, setting the content type to "text/cache-manifest". However when i'm loading my cached page in Chrome i get the following error in Chrome's console (note empty string in brackets), and the files are never updated:
Application Cache Error event: Invalid manifest mime type () http://localhost:4010/WebClient/CacheManifest.ashx
This was working fine before for almost a year, and how suddenly started happening.
Any ideas?
Here's the code-behind for CacheManifest.ashx:
public class CacheManifest : IHttpHandler
{
public bool IsReusable
{
get
{
return true;
}
}
public void ProcessRequest(HttpContext context)
{
HttpResponse response = context.Response;
response.Clear();
response.ContentType = "text/cache-manifest";
StringBuilder output = new StringBuilder();
output.AppendLine("CACHE MANIFEST");
output.AppendLine();
output.AppendLine("CACHE:");
// here's the code that loads files from disk and adds to manifest.
// allow online resources
output.AppendLine("NETWORK:");
output.AppendLine("*");
output.AppendFormat("# hash: {0}", GetContentHash());
response.Write(output.ToString());
}
}