缓存清单文件需要按清单9所示修改。
The cache manifest file needs to be modified as in Listing 9.
任何相对urls必须相对于缓存清单文件。
Any relative URLs must be relative to the cache manifest file.
该方法将重新加载在缓存清单文件中指定的所有文件。
This will re-load all of the files specified in the cache manifest file.
如前所述,浏览器首先检查缓存清单文件的一个更新。
As mentioned earlier, the browser first checks for an update to the cache manifest file.
该属性的值必须是到缓存清单文件的路径,如下所示。
The value of this attribute must be the path to the cache manifest file, as demonstrated below
在本例中,缓存清单文件位于您的Web应用程序的根目录。
In this case, the cache manifest file is in the root directory of your Web application.
Web浏览器需要知道您想启用缓存,以及到哪里去找到您的缓存清单文件。
The Web browser needs to know that you want to enable caching and where to find your cache manifest file.
manifest参数的值是到该Web页面的缓存清单文件的URL。
The value of the manifest parameter is the URL to the Web page's cache manifest file.
清单2. to -do列表应用程序(todo .manifest)的资源缓存清单文件。
Listing 2. Resource cache manifest for the to-do list application (todo.manifest).
缓存清单是一个文本文件,按顺序列出所有需要缓存的应用程序资源,确保特定应用程序运行,而无需连接因特网。
The cache manifest is a text file that lists all application resources that need to be cached in order for the given application to work without an Internet connection.
创建过程涉及一个关键文件:您的应用程序的缓存清单。
One key file is involved: the cache manifest for your application.
在缓存清单中列出的文件存储在应用程序缓存中,类似浏览器的标准磁盘缓存但是更为健壮。
The files listed in the cache manifest get stored in the application cache, which is like the browser's standard disk cache but much more robust.
如上所述,清单指定需要加载到缓存中的文件。
As mentioned, the manifest specifies the required files that need to be loaded into the cache.
清单2显示一个样例全局cachespec . xml文件以及Web服务调用的一个缓存条目。
Listing 2 shows a sample global cachespec.xml file with a single cache entry for the web service call.
从清单1中可以看出,该配置文件将内存缓存指定为一个LRUMemoryCache。
You can see from the last line in Listing 1 that the configuration file specifies the memory cache as a LRUMemoryCache.
步骤3中所示的示例(参见清单 3)发出第一次远程SSH调用(ls-d /tmp)到目标服务器,从而缓存您的服务器的 .ssh/known_hosts文件内的密钥。
The example shown for step 3 (see Listing 3) makes the first-time remote SSH call (ls -d /tmp) to the destination server, thereby caching the key within your server's .ssh/known_hosts file.
指向缓存清单的文件(在本例中是sample.html)无需列出。
The file pointing to the cache manifest (sample.html in this example) does not need to be listed.
如果web页面引用一个未列入清单的文件,应用程序可能不会缓存,因而就不能脱机使用。
If the web page references an unmanifested file, the application may not be cached for offline use.
web服务器应当在不带缓存响应头的情况下为清单文件提供服务。
The web server should serve the manifest file with no-cache response headers.
引用清单的HTML文件自动包含在应用程序缓存中。
The HTML file with the reference to the manifest is automatically included in the application cache. The manifest contains only the following.
如果出现任何失败,那么您可能在缓存清单中遗漏了一些文件。
If anything fails, then you might have left out some files in the cache manifest.
缓存清单没有过期一说,因此所有资源都将保持缓存状态,除非用户清空缓存或清单文件更改。
There is no expiry on a cache manifest, so everything stays cached unless the user clears the cache or the manifest file changes.
为了便于参考,清单3给出对静态文件的HTTP请求和对浏览器缓存的静态文件的HTTP响应。
For your reference, Listing 3 is a HTTP request for a static file and the HTTP response for a browser-cached static file.
复制样例全局缓存配置文件(清单2),确保文件名是cachespec . xml。
Copy the sample global cache configuration file (Listing 2), make sure the file name should be cachespec.xml.
清单1显示的是最基本的cache . ccf文件—一个纯内存缓存配置。
Listing 1 displays the most basic cache.ccf file - a pure memory-cache configuration.
我们用来下载和缓存sonnetplist所用的对象在其头文件GRplistController . h内描述,如清单4所示。
The object that we'll use to download and cache the sonnet plist is described in its header file, GRplistController.h, which is shown in Listing 4.
缓存执行这些完整性检查以确保程序集未被篡改(例如,当文件已更改但清单未反映此更改时)。
The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change.
缓存执行这些完整性检查以确保程序集未被篡改(例如,当文件已更改但清单未反映此更改时)。
The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change.
应用推荐