0

The below combination works fine on IE, Chrome and Opera but fails on Firefox. Firfox just ignores manifest file.

entry.html

<html manifest="manifest.php">
  <h1>Application Cache Example</h1>

  <script>
    function onUpdateReady() {
      console.log('found new version!');
    }
    window.applicationCache.addEventListener('updateready', onUpdateReady);
    if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
        onUpdateReady();
    }

    function update_picture() {
      document.getElementById('picture').src='messenger.png '
    }
  </script>
</html>

manifest.php

header('Content-Type: text/cache-manifest');

$lines = array();

$lines[] = 'CACHE MANIFEST';
$lines[] = '/picture1.gif';
$lines[] = '/picture2.gif';
$lines[] = '/picture3.gif';
$lines[] = '/picture4.gif';
$lines[] = '/picture5.gif';
$lines[] = '/picture6.gif';
$lines[] = '/picture7.gif';
$lines[] = '/picture8.gif';
$lines[] = '/picture9.gif';
$lines[] = '/picture10.gif';

echo implode("\r\n",$lines);

I'm trying to figure out the problem for the last 4 days already. Just can't get the idea why Firefox doesn't want to cache pictures.

Any ideas, comments or solutions will be welcome. Thank you in advance.

Alex F
  • 183
  • 2
  • 14

1 Answers1

0

A Manifest should have section headers also of either CACHE, NETWORK or FALLBACK. Try to add them and see if Firefox works better. Also, all files in the manifest must be reachable. Any failures to download a file can result in a delete application cache.

CACHE MANIFEST

# version 1

CACHE:
/picture1.gif
/picture2.gif

NETWORK:
*