Cache external image in a PhoneGap App

2020-06-29 06:06发布

I have 3rd party images being used in a application. I don't want to download and package them in the app because it would violate copyright.

How can I have the application on first time opening, load all the images and cache them, so that if its opened again offline the images could still be accessed?

1条回答
Viruses.
2楼-- · 2020-06-29 06:41

Try using cache manifest: http://www.w3.org/TR/html5/offline.html. Allows you specify content to be cached for offline use.

Change your html tag to:

<html manifest="cache.appcache">

In the cache.appcache file:

CACHE MANIFEST
index.html
image1.jpg
image2.jpg
查看更多
登录 后发表回答