开发者

Do I need to add the files who are hosted on CDN inside in manifest file HTML 5 manifest file for offline caching?

开发者 https://www.devze.com 2023-04-05 22:42 出处:网络
Do I need to add the files who are hosted on CDN inside in manifest filefor offline caching? This a example maniefest file

Do I need to add the files who are hosted on CDN inside in manifest file for offline caching?

This a example maniefest file

CACHE MANIFEST
#This is a comment

CACHE
index.html
style.css

NETWORK:
search.php
login.php

FALLBACK:
/api offline.html

But in my project I'm using some files which are hosted on cdn

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>开发者_Go百科;
<script src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>

How to include these cdn files in manifest file?


According to spec you can't include these files because they are not same origin as manifest file.

The manifest

This is the resource corresponding to the URL that was given in a master entry's html element's manifest attribute. The manifest is fetched and processed during the application cache download process. All the master entries have the same origin as the manifest.


As far as I am aware you cannot. According to the W3C documentation all cached content must satisfy the same origin policy. You can read all about it here among other places.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号