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
0
91
Caching in HTTP
初探 HTTP 1.1 Cache 機制,透過簡單的實驗來說明瀏覽器對於 HTPP Cache 的實作策略。
SJ Chou
January 13, 2014
Tweet
Share
More Decks by SJ Chou
See All by SJ Chou
LLM RAG 擷取增強生成介紹 - 3 種 RAG/Self-RAG/CRAG 全解析
samejack
0
35
NVIDIA Omniverse Kit Introduction
samejack
0
30
用 Keras 玩 Machine Learning
samejack
0
140
2020 MLaaS 產業介紹
samejack
0
57
Linux Container Introduction
samejack
0
37
Cloud Foundry Introduction
samejack
0
54
WordPress Blog SEO 兩三事
samejack
0
72
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
0
110
軟體品質與持續整合
samejack
1
94
Other Decks in Programming
See All in Programming
Claude Codeの使い方
ttnyt8701
1
130
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
220
Webからモバイルへ Vue.js × Capacitor 活用事例
naokihaba
0
760
Select API from Kotlin Coroutine
jmatsu
1
190
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
850
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
17
4.9k
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
570
Effect の双対、Coeffect
yukikurage
5
1.4k
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.2k
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
310
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Making Projects Easy
brettharned
116
6.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
The Pragmatic Product Professional
lauravandoore
35
6.7k
A better future with KSS
kneath
239
17k
Raft: Consensus for Rubyists
vanstee
140
7k
Statistics for Hackers
jakevdp
799
220k
Building an army of robots
kneath
306
45k
BBQ
matthewcrist
89
9.7k
Code Reviewing Like a Champion
maltzj
524
40k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Unsuck your backbone
ammeep
671
58k
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