Philip Kirkbride
Philip Kirkbride

Reputation: 22899

Cache external image in a PhoneGap App

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?

Upvotes: 1

Views: 6664

Answers (1)

nathancahill
nathancahill

Reputation: 10850

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

Upvotes: 4

Related Questions