HTML5 application cache for .json files?

Does application cache work with files other than images and js / css / html?

I am trying to cache .json files that are later called via XMLHttpRequest on a URL resources/data/countries.json

, but the browser is calling home and not using the cached file.

Checking the app cache with Chrome I see a. Regular files (js / css / html / images) work as expected. No error occurs during the caching / loading process.

Is it the reason this just doesn't work with the application cache, or could it be something else?

Thank!

+3
javascript html5 ajax caching html5-appcache


source to share


1 answer


I had the same problem. I would rename the file as country.txt and serve it as a text / simple mime type. On the client side, you can parse the file as json.



0


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics