angularangular-clihtml5-appcache

Is it possible to Use HTML5 AppCache in an Angular 4 Project?


I have been trying to use AppCache in my Angular CLI project, and have been following all AppCache guides which seem pretty straight forward, but I keep getting this error:

enter image description here

My manifest.appcache file is in the same directory as my index.html.

manifest.appcache:

enter image description here

I have also tried referencing the manifest.appcache file through an iframe tag, but i also get an error by doing that saying that the it cannot find that iframe-inject-appcache-manifest.html file either. I'm am not sure if it is possible to implement AppCache on angular 4


Solution

  • The fact that your browser receives a 404 seems to point to a web server configuration problem more than an Angular specific issue.

    You may want to dig in for angular cli's server configuration or (if it is not exposed) go for a standard alternative (Apache/nginx/express...)

    Also note that the manifest is supposed to be served by your web server with the mime type: text/cache-manifest, though this article says it is not mandatory anymore.