Adding appcache code and explanation.