1

画像をブラウザにキャッシュして、特定の期間が経過すると期限切れになるようにするにはどうすればよいですか

4

1 に答える 1

1

There are several HTTP headers that you can use to effect changes to the content caching policies.

This one:

Cache-control: no-cache

instructs the browser not to cache the content at all.

This one:

Expires: Tue, 20 Mar 2024 02:00:00 GMT

instructs the browser to expire its cached copy by the given time.

This one:

ETag: ab10be20

instructs the browser to consider ab10be20 as a hash of the contents and only if the value changes upon subsequent requests should it need to download the new contents.

Note that all of these are effectively advisory only and there's no possible way to enforce the purging of caches remotely.

于 2012-07-20T02:59:11.880 に答える