Tipo de mimo de manifiesto no válido cuando se sirve a través del controlador ashx

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.

¿Alguna idea?

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());
    }
}

preguntado el 01 de febrero de 12 a las 03:02

1 Respuestas

Base on my testing, it's due to localhost. The web browser is no able to download it from localhost. When I do a deployment to production (real webserver in the web), it works flawlessly.

Respondido 11 Oct 12, 11:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.