$30 off During Our Annual Pro Sale. View Details »
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
95
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
84
NVIDIA Omniverse Kit Introduction
samejack
0
50
用 Keras 玩 Machine Learning
samejack
0
150
2020 MLaaS 產業介紹
samejack
0
69
Linux Container Introduction
samejack
0
40
Cloud Foundry Introduction
samejack
0
58
WordPress Blog SEO 兩三事
samejack
0
76
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
0
120
軟體品質與持續整合
samejack
1
97
Other Decks in Programming
See All in Programming
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
190
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
GeistFabrik and AI-augmented software development
adewale
PRO
0
250
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
140
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
370
React Native New Architecture 移行実践報告
taminif
1
130
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
730
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
570
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
24
21k
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
4.1k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
5
260
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
18k
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Docker and Python
trallard
46
3.7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
A designer walks into a library…
pauljervisheath
210
24k
Building Applications with DynamoDB
mza
96
6.8k
Visualization
eitanlees
150
16k
GitHub's CSS Performance
jonrohan
1032
470k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
The Pragmatic Product Professional
lauravandoore
37
7.1k
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