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
83
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
用 Keras 玩 Machine Learning
samejack
0
120
2020 MLaaS 產業介紹
samejack
0
34
Linux Container Introduction
samejack
0
26
Cloud Foundry Introduction
samejack
0
45
WordPress Blog SEO 兩三事
samejack
0
67
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
0
110
軟體品質與持續整合
samejack
1
83
Android_Day_2013_-_Mobile_Web_App_Design.pdf
samejack
0
89
REST to RESTful Web Service
samejack
2
200
Other Decks in Programming
See All in Programming
Temporalを取り巻く仕様を整理する
sajikix
0
110
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
OpenAI/Gemini APIを使って EPUBを翻訳するCLIツールをつくってみた
tomiyan
0
790
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
AHC035解説
terryu16
0
710
Polarsの成長: v0.14からv1.0までの変遷と今後の展望
zerebom
1
350
小さな開発会社を作った理由
polidog
0
1.9k
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
日付と正規化
megmogmog1965
0
140
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
AWS初心者ってどうやってAWSを学ぶ?〜アプリエンジニアがやってよかったアーキテクチャ学習方法〜
yamanashi_ren01
0
190
継続的な活動で築く地方エンジニアの道
myamashii
2
350
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
502
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
245
1.2M
Large-scale JavaScript Application Architecture
addyosmani
506
110k
Imperfection Machines: The Place of Print at Facebook
scottboms
262
13k
Designing with Data
zakiwarfel
96
5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
How GitHub (no longer) Works
holman
305
140k
YesSQL, Process and Tooling at Scale
rocio
166
14k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
Facilitating Awesome Meetings
lara
46
5.8k
Bash Introduction
62gerente
607
210k
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