Question

Ok, I'm building a PoC for an ASP.NET MVC 4 mobile application that needs to have offline capabilities, and I have several questions about whether I'm designing the application correctly and also what behavior I will get from the cache manifest.

I'm progressing with the PoC but I'm observing a weird behavior on a working controller action right after adding the manifest attribute to my Layout.cshtml.

Before adding the attribute, every time I requested that URL, a breakpoint I had on the controller action would be hit just once every time. After adding it, the breakpoint is being hit 3 times the first time the page is requested (first time ever), and it is no longer hit at all until I manually delete the local cached manifest.

Nothing else changed, so this makes me believe that this type of offline caching works differently that the regular way in which browsers cache works. I'm thinking that since the page I'm visiting is listed on the manifest, the breakpoint is hit the first time because I requested the page, and then a second time because it is listed on the manifest.

That is weird already. Why is that?

Besides that, why is it being hit a third time?

I've verified that the behavior goes away if I manually delete the locally cached manifest and also remove the manifest attribute from the html tag, so this is most likely the culprit.

Can anyone explain what's going on please? Thanks.

Was it helpful?

Solution

Well, no one replied and I was no longer able to reproduce the breakpoint being hit 3 times, although I'm sure it happened a few times.

And yes, appcache or html manifest caching works in a different way than regular caching.

With the first visit a page, that had the manifest attribute on its html tag, the same page being listed on the manifest made a request to the server for the same page.

I'm making the answer a wiki in case someone wants to add anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top