LoginSignup
1
0

More than 5 years have passed since last update.

「Cache-Control: no-cache = キャッシュしない」は間違い

Posted at

一切キャッシュしない設定はno-cacheではなくno-store。

//リクエストやレスポンスを一切キャッシュしない
Cache-Control: no-store

//no-cache = キャッシュしない ではない・・・
Cache-Control: no-cache

以下、Cache-Control: no-storeについての説明
(意訳)
・キャッシュしない 
いかなるリクエスト/レスポンスについての情報をキャッシュしない。リクエストはサーバに送られ、完全なレスポンスが毎回ダウンロードされる

No caching
The cache should not store anything about the client request or server response. A request is sent to the server and a full response is downloaded each and every time.

以下、Cache-Control: no-cacheについての説明
(意訳)
・キャッシュするがrevalidateする
キャッシュはするけど、そのキャッシュを使う前にオリジンサーバにvalidationリクエストを送る

Cache but revalidate
A cache will send the request to the origin server for validation before releasing a cached copy.

no-cacheはオリジンサーバに「このキャッシュ使っても大丈夫?」って確認してからキャッシュを使うということですね。

参考

https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
(日本語版ではno-cacheの説明のタイトルが「キャッシュしない」になっていますが間違いだと思われます。2019/05/01)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0