iPad safari 移动 JavaScript 文件缓存
iPad Safari 是否缓存 JavaScript 文件?似乎没有。如果我的 Safari 不缓存脚本,我怎样才能做到这一点?
Does iPad Safari cache JavaScript files? It seems to be no. If my Safari doesn't cache scripts, how can I make it to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建清单文件 (请参阅此处声明清单文件)
清单file 指定要下载并存储在应用程序缓存中的资源,例如 HTML、JavaScript、CSS 和图像文件。第一次加载网页后,清单文件中指定的资源将从应用程序缓存中获取,而不是从 Web 服务器获取。
清单文件具有以下属性:
它必须以 text/cache-manifest 类型提供。
第一行必须包含文本 CACHE MANIFEST。
后续行可能包含要缓存或的每个资源的 URL
注释。
注释必须在单行上,并且前面有 # 字符。
URL 是您要下载和缓存的资源的文件路径
本地。文件路径应该相对于文件的位置
清单文件 - 类似于 CSS 中使用的文件路径 - 或绝对路径。
声明清单文件的 HTML 文件,如声明中所述
清单文件会自动包含在应用程序缓存中。
您不需要将其添加到清单文件中。
摘自:
https://developer.apple .com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/Client-SideStorage/Client-SideStorage.html
有关 HTML5 离线应用程序缓存的更多信息< /a>
Creating a Manifest File (See here for declaring a manifest file)
The manifest file specifies the resources—such as HTML, JavaScript, CSS, and image files —to downloaded and store in the application cache. After the first time a webpage is loaded, the resources specified in the manifest file are obtained from the application cache, not the web server.
The manifest file has the following attributes:
It must be served with type text/cache-manifest.
The first line must contain the text CACHE MANIFEST.
Subsequent lines may contain URLs for each resource to cache or
comments.
Comments must be on a single line and preceded by the # character.
The URLs are file paths to resources you want to download and cache
locally. The file paths should be relative to the location of the
manifest file—similar to file paths used in CSS—or absolute.
The HTML file that declares the manifest file, described in Declaring
a Manifest File, is automatically included in the application cache.
You do not need to add it to the manifest file.
Excerpt from:
https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/Client-SideStorage/Client-SideStorage.html
More info about the HTML5 Offline Application Cache