質問

If I include in my application cache manifest:

/example.html

and this redirects to

https://s3.amazonaws.com/longURL/example.html?dynamicauthenticationparameters

will this work?

The current draft HTML5 specification seems to be silent on redirects for content files (as opposed to the manifest itself) apart from referring to a manual redirect flag, which apparently is set but (as far as I can tell) never actually used.

(The intention is to avoid proxying some S3 content, but to still make it available offline using the cache mechanism. JavaScript and LocalStorage would presumably be a workaround if the above can't be done).

Any pointers to the relevant part of a spec and/or current browser implementation behavior would be helpful.

役に立ちましたか?

解決

The current specification now states that if the resource is redirected to a different origin, then this is treated as a failure and the local cached copy (or fallback) is used instead.

In section 5.6.4 of http://www.w3.org/TR/2011/WD-html5-20110525/offline.html it states that:

Redirects are fatal because they are either indicative of a network problem (e.g. a captive portal); or would allow resources to be added to the cache under URLs that differ from any URL that the networking model will allow access to, leaving orphan entries; or would allow resources to be stored under URLs different than their true URLs. All of these situations are bad.

So sadly you can't serve some pages from Amazon S3 or Cloudfront.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top