I have the HTML template resource "steg3rad.html" stored in my appcache manifest. In my javascript file I fetch the template file using an jQuery AJAX GET request. Sometimes jQuery adds a callback parameter to the GET request. This results in Chrome not managing to load the resource from the appcache, see screenshot below. This causes errors in my pages.

Screenshot of error in Chrome network log

Why can Chrome/the appcache not handle the parameters?

有帮助吗?

解决方案

It looks like the Ajax cache option is set to false.

I think the whole point with the callback parameter we see in the screenshot is to make each call unique, and there is little point in caching something that is always unique. (Read more about the cache option in the Ajax API documentation.)

So, essentially you're telling the browser to cache something in one place (the appcache manifest) and you're telling it to not cache that same thing in another place (the ajax request). Maybe you get the behavior you want if you remove the ambiguity by setting the Ajax cache option to true?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top