0

Let's say I have a website with following pages:

www.server.com/index.php
www.server.com/anotherPage.php
www.server.com/css/style_for_index.css
www.server.com/css/style_for_anotherPage.css

Assuming, I am visiting www.server.com/index.php:

When using .appcache manifest in the <HTML> tag, I understand that every associated file of this page is automatically cached anyway.

But if I wanted to load, at the same time, www.server.com/anotherPage.php, then I would also have to load www.server.com/css/style_for_anotherPage.css in the CACHE section of the manifest.appcache file.

What I don't understand is if I would also have to include the background-images from www.server.com/css/style_for_anotherPage.css into the manifest.appcache file.

RoRu
  • 15
  • 7

1 Answers1

0

I understand that every associated file of this page is automatically cached anyway.

This is incorrect.

You need to explicitly mention any resource you want to be cached, except for the so-called master entries. Master entries are the HTML files that include a manifest attribute in their <html> element. So also any images, scripts, stylesheets referenced by these files.

Obviously, you need to also include any files referenced by your css or javascript files, if you want them to be available offline.

Myrne Stol
  • 11,222
  • 4
  • 40
  • 48
  • ok thank you very much! best would be to automatically read all the background-image url's from out of the css files and make them have an absolute path to root and add them to manifest.appcache. – RoRu May 15 '13 at 12:48
  • @user2384968 You're right it's best to automate the process. The following tool helps you get started quickly: http://appcache.rawkes.com/ . – Myrne Stol May 15 '13 at 13:41