From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/zh-tw/glossary/cacheable/index.html | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 files/zh-tw/glossary/cacheable/index.html (limited to 'files/zh-tw/glossary/cacheable') diff --git a/files/zh-tw/glossary/cacheable/index.html b/files/zh-tw/glossary/cacheable/index.html new file mode 100644 index 0000000000..f8e744e1d3 --- /dev/null +++ b/files/zh-tw/glossary/cacheable/index.html @@ -0,0 +1,59 @@ +--- +title: 可緩存 +slug: Glossary/cacheable +tags: + - 緩存 + - 術語表 +translation_of: Glossary/cacheable +--- +

可緩存的響應是可被緩存的HTTP 響應,它被存儲以供稍後檢索和使用,從而將新的請求保存在伺服器。不是所有的 HTTP 響應都可以被緩存,可以被緩存的 HTTP 響應需滿足如下列條件:

+ + + +

請注意一些不緩存請求/響應到指定的 URI 可能會導致相同 URI 上以前的緩存響應失效。例如,  {{HTTPMethod("PUT")}} 到 pageX.html 將使相同 URI 下所有的 {{HTTPMethod("GET")}} 或 {{HTTPMethod("HEAD")}} 請求緩存失效。

+ +

同樣的,如果請求的方法和響應的狀態都可以被緩存,那請求的響應也都將可以被緩存:

+ +
GET /pageX.html HTTP/1.1
+(…)
+
+200 OK
+(…)
+
+ +

{{HTTPMethod("PUT")}} 請求不能被緩存. 此外,它還將導致所有來源為 {{HTTPMethod("HEAD")}} or {{HTTPMethod("GET")}} 相同的 URI 緩存數據無效 :

+ +
PUT /pageX.html HTTP/1.1
+(…)
+
+200 OK
+(…)
+
+ +

指定的 {{HTTPHeader("Cache-Control")}} 頭部在響應中可以阻止緩存:

+ +
GET /pageX.html HTTP/1.1
+(…)
+
+200 OK
+Cache-Control: no-cache
+(…)
+ +

了解更多

+ +

基礎知識

+ + + +

技術資訊

+ + -- cgit v1.2.3-54-g00ecf