开发者

HTML5 manifest file

What is purpose of network section in the HTML5 manifest file? If I add a file in that section, doesnt it mean that the browser should 开发者_高级运维not cache it, and it should be available only online? I've added the file in Network section, but once I visit it online, it is always available offline. I have checked with FF5 and Chrome. Here is my full manifest code, please see what is wrong with it? Thanks.

CACHE MANIFEST

# cache files
CACHE:
index.html
offline.html
images/logo.jpg

# offline.html for all uncached pages
FALLBACK:
/ offline.html

# this should be available online only
NETWORK:
network.html


Obviously, it's a bug: http://code.google.com/p/chromium/issues/detail?id=91524


The manifest file allows for offline web applications where it 'caches' all the files listed in the manifest file and keeps them up to date for offline usage.

The NETWORK section in theory is the section to exclude * (everything) or a single file like you're trying to do with network.html. However, application caching with the manifest file doesn't rule out the 'old-fashion' caching mechanisms browsers have.

You've probably set some static content to be cache-able by the browser so depending on what server IIS/Apache you need to adjust your Expire / Cache-control settings.


Adding the file in the NETWORK Section, still saves file in cache and shows from the cache when I am online, whereas my expectation is it should ALWAYS fetch from online.

When I add "meta http-equiv="Pragma" content="no-cache" it always fetches that file from server


The pragma is a meta type that is primariyly used for IE. You might try setting the cache-control to no-cache add the pragma for IE and set the meta's for expire, public, store etc.. to control the page. At this point, creating the manifest file does cause browser caching to be enabled. You must add the mime-type text/cache-manifest and save the file with the extension .appache .

Example:

CACHE MANIFEST 
# the above is a required line
# this is a comment 
# spaces are ignored
# blank lines are ignoredCACHE:
/favicon.ico
index.cfm

# offline.html for all uncached pages
FALLBACK:
/ offline.html

# this should be available online only
NETWORK:
network.html

Best regards, Link Worx Seo


I had similar problems.

Try configuring your server to expire content immediately in the HTTP Response Headers section like in the link above if the site is hosted on IIS.

If it is hosted on Apache you'll probably want to look at this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜