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
SJ Chou
January 13, 2014
Programming
100
0
Share
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
12
LLM RAG 擷取增強生成介紹 - 3 種 RAG/Self-RAG/CRAG 全解析
samejack
1
110
NVIDIA Omniverse Kit Introduction
samejack
1
70
用 Keras 玩 Machine Learning
samejack
1
160
2020 MLaaS 產業介紹
samejack
1
84
Linux Container Introduction
samejack
1
45
Cloud Foundry Introduction
samejack
1
73
WordPress Blog SEO 兩三事
samejack
1
84
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
1
120
Other Decks in Programming
See All in Programming
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.2k
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
490
ファインチューニングせずメインコンペを解く方法
pokutuna
0
230
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
470
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
240
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
440
安いハードウェアでVulkan
fadis
1
860
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
420
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
230
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Skip the Path - Find Your Career Trail
mkilby
1
93
How to make the Groovebox
asonas
2
2.1k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
490
Paper Plane
katiecoart
PRO
0
48k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Color Theory Basics | Prateek | Gurzu
gurzu
0
270
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
How to train your dragon (web standard)
notwaldorf
97
6.6k
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