In my HTML5 application I have several HTML files that represent books. Each 'book' contains images that are specific for that book. Each book file also has references to CSS and JavaScript files that are shared by all books.
I want to cache the books in the HTML5 application cache so that they can be viewed without internet connection. I guess I have to create a manifest file for each HTML book file, containing references to the shared resources and the images in the book. The tags in the HTML files would then look like:
<html manifest="Book1.appcache">
or:
<html manifest="Book2.appcache">
and Book1.appcache like:
CACHE MANIFEST
Js/Book.js # Shared
Css/Book.css # Shared
Images/Book1-cover.png # Book-specific
and Book2.appcache like:
CACHE MANIFEST
Js/Book.js # Shared
Css/Book.css # Shared
Images/Book2-cover.png # Book-specific
I am not certain about this design, this way it seems each book is its own 'application', which is not the case. Also, aren't the shared CSS and JS files cached multiple times, once for each book? Can anyone recommend a good solution?