Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Cache File Extension – .appcache OR .cachemanifest

Posted by Paul on May 3, 2015


I have been observing some arguments about offline application cache file extension:

  1. Is .appcache the right extension?
  2. Is .cachemanifest the right extension?

Who is the Authority?

The authority to decide extension & MIME types goes to W3C (World-Wide-Web-Consortium). This also means that no company nor browser nor developer can set the standard.

All Extensions are Right!

Going through W3C, I cannot find any restriction to use .appcache or .cachemanifest extensions.   You can use whatever extensions you prefer!

WC3 only restricts to use the right MIME type of text/cache-manifest.  So all the extensions are right if they render the right MIME type.

link

See below link:

http://www.w3.org/TR/2011/WD-html5-20110525/offline.html

W3C is the authority to decide on extensions or MIME types. All browsers are written to align with these standards.

How MIME type works?

In SharePoint terms, MIME type acts as the Content Type.  When the browser fetches one file for eg: abc.jpg it doesn’t know what to do with it.  Then it will request the MIME type and understand it as image/jpg which makes the decision to render it as image.

Browser Support

Browsers are bound to support any MIME type regardless the file extension.  Basically, it has to look into the MIME type rather than file extensions.

Example: IE, Chrome, Firefox, WorxWeb

Going with O365

Going with O365 one may get disappointed seeing the .appcache is no longer mapped to text/cache-manifest.  It will return another mime type as application-octetstream.  Clearly, this won’t serve our purpose & O365 does not allow changing MIME types as the IIS is managed by Microsoft.

But, there is a solution.  O365 provides another extension .cachemanifest with the MIME type text/cache-manifest.  We need to use this extension for offline application cache files.

Why O365 .appcache has wrong MIME type?

First of all we cannot call it as wrong as W3C never said “.appcache is the correct extension”.  O365 inherits IIS older versions where .appcache served a different purpose. (era before offline application cache).  If Microsoft is going to change the .appcache to text/cache-manifest, then the existing applications using application-octetstream will break.

Note

Please open IIS Manager > MIME types to ensure the right MIME type is being associated with the extension.

References

http://www.w3.org/TR/2011/WD-html5-20110525/offline.html

http://www.jeanpaulva.com/index.php/2015/03/25/right-mime-type-for-application-cache/

Summary

The conclusion is “all extensions are right”.  The browsers are bound to support it as long as the right MIME type is served.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s