3
votes

"Application Cache manifest had an incorrect MIME type: text/plain."

Getting the same message again and again yet I get my content cached. Browsers on which I am facing this problem: IE9/10 and Safari. My Mozilla and chrome gives and output fine.

Code:

<script type="text/javascript">
  function logEvent(event) {
      alert(event.type);
  }

  window.applicationCache.addEventListener('checking',logEvent,false);
  window.applicationCache.addEventListener('noupdate',logEvent,false);
  window.applicationCache.addEventListener('downloading',logEvent,false);    
  window.applicationCache.addEventListener('cached',logEvent,false);
  window.applicationCache.addEventListener('updateready',logEvent,false);
  window.applicationCache.addEventListener('obsolete',logEvent,false);
  window.applicationCache.addEventListener('error',logEvent,false);

</script>
1

1 Answers

3
votes

MIME type should be text/cache-manifest. This is required on old browsers.

This requirement was dropped from the specification some time ago, and no longer required by the latest versions of Chrome, Safari and Firefox, but you'll need the mime-type to work in older browsers and IE11.

A Beginner's Guide to Using the Application Cache