NOTE: Update at bottom of post
I want to cache page resources in the application cache so that I can open a VisualForce page while offline.
I have specified the cache manifest in the
<apex:page> as follows:
<apex:page doctype="html-5.0" manifest="/apex/manifestpage" showheader="false" sidebar="false" standardstylesheets="false" cache="false">
and the manifest itself as follows:
<apex:page contentType="text/cache-manifest" applyHtmlTag="false" standardStylesheets="false" showHeader="false">CACHE MANIFEST /apex/MyPage NETWORK: * </apex:page>
If the page is exposed and requested via a Force.com site, then the manifest is checked and all of the resources are downloaded.
However, if the page is opened as a standard VisualForce page, then there is an error after the applicationCache's
Application Cache Error event: Failed to parse manifest
- I have checked this post on stack exchange.
- I have validated the Cache Manifest using this cache manifest validator
- I have checked these specs to confirm what format is expected during the parse of the manifest and am pretty sure I have everything right.
The bottom line is that everything is working perfectly if the page is accessed by a force.com site, but not if accessed by as a stand-alone VF page which I need to do in order to access this page in a Salesforce1 app.
Can anybody give me a hint as to why this may be the case?
I see that when the page is delivered as a stand-alone VF page, it is rendered in an iframe. Whereas, when exposed as a site, there is no iframe.
The outer html tag of the VF page has no manifest attribute, and it is the iframe's html tag that has the manifest attribute.
In addition, the safari browser gives a different error to the one specified above (which was shown by Chrome). We get:
[Error] Application Cache manifest could not be fetched, because a redirection was attempted.