質問

If I use HTML5 offline storage to cache a file like so in the manifest:

CACHE:
render_image.php

then what happens if the page includes code like so?:

<img src="render_image.php?look_ma_get_parameter" alt="foo" />

My experimenting indicates that offline storage treats render_image.php as different from render_image.php?look_ma_get_parameter. This is the behavior I want, so that's good. But I want to make sure that this is something that I can rely on, and not merely the behavior of the browser I tested.

Can I rely on this behavior? Is it part of the spec?

役に立ちましたか?

解決

The appcache spec says:

One or more resources (including their out-of-band metadata, such as HTTP headers, if any), identified by URLs, each falling into one (or more) of the following categories:

and the query string is part of a URL, so we can guess <img src="render_image.php?look_ma_get_parameter" alt="foo" /> will get resource from server.

I haven't tested this, but I found some thread about this Cache manifest and query strings. I think the writer of this answer already tested about this.

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