Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Caching in HTTP
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
SJ Chou
January 13, 2014
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Caching in HTTP
初探 HTTP 1.1 Cache 機制,透過簡單的實驗來說明瀏覽器對於 HTPP Cache 的實作策略。
SJ Chou
January 13, 2014
More Decks by SJ Chou
See All by SJ Chou
LangChain Framework 與 RAG 實做教學
samejack
1
19
LLM RAG 擷取增強生成介紹 - 3 種 RAG/Self-RAG/CRAG 全解析
samejack
1
130
NVIDIA Omniverse Kit Introduction
samejack
1
95
用 Keras 玩 Machine Learning
samejack
1
170
2020 MLaaS 產業介紹
samejack
1
99
Linux Container Introduction
samejack
1
57
Cloud Foundry Introduction
samejack
1
93
WordPress Blog SEO 兩三事
samejack
1
87
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
1
130
Other Decks in Programming
See All in Programming
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
19
6.4k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.2k
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
520
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
140
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
200
スマートグラスで並列バイブコーディング
hyshu
0
110
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
210
AIで効率化できた業務・日常
ochtum
0
120
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
480
CSC307 Lecture 17
javiergs
PRO
0
320
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
110
OSもどきOS
arkw
0
470
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
The untapped power of vector embeddings
frankvandijk
2
1.8k
Skip the Path - Find Your Career Trail
mkilby
1
140
Odyssey Design
rkendrick25
PRO
2
690
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
440
The SEO identity crisis: Don't let AI make you average
varn
0
490
Measuring & Analyzing Core Web Vitals
bluesmoon
9
860
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
Caching in HTTP SJ 2016/07/25 Email:
[email protected]
Blog: http://blog.toright.com
回顧 HTTP 1.1 的設計理念 Architectural Styles and the Design of
Network-based Software Architectures (by Roy Thomas Fielding) CHAPTER 5. Representational State Transfer (REST)
HTTP Features • HTTP 1.1 設計 Cache 的目的在降低 Request 與
Full Response • 以下兩個主要的設計理念 ◦ Expiration ◦ Validation • 實作上透過 Header 讓 Server 與 Client 可以 自由定義 Cache 的方式
HTTP 1.0 與 HTTP 1.1 Caching Difference HTTP 1.0 Reponse
Cache Header ◦ Expires ◦ Pragma HTTP 1.1 Reponse Cache Header ◦ Cache-Control
介紹 HTTP 1.1 Cache-Control Header • Response Cache Header ◦
no-store 完全不 Cache ◦ no-cache 允許 Cache 但是每次都會檢查 Cache 狀態 ◦ max-age 設定要 Cache 幾秒 ◦ private Cache 只給目前使用者使用 ◦ public Cache 可共用 (HTTPS不可共用) ◦ must-revalidate 交由 Client 自行決定要不要使用 Cache • 可以混搭
如何檢查 Cache 是否有效? • 時間導向 (秒為單位) Last-Modified / If-Modified-Since •
檔案內容導向 (Hash) ETag / If-None-Match
Cache-Control: no-store
Cache-Control: no-cache
Cache-Control: max-age
Cache-Control: private
Cache-Control: public
Cache-Control: must-revalidate
Reference • HTTP 1.1 RFC 2616 - 14.9 Cache-Control •
HTTP 1.1 RFC 2616 - 13 Caching in HTTP • Architectural Styles and the Design of Network-based Software Architectures - 5 Representational State Transfer (REST)
Thanks! The End Email:
[email protected]
Blog: http://blog.toright.com