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
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
90
NVIDIA Omniverse Kit Introduction
samejack
0
53
用 Keras 玩 Machine Learning
samejack
0
150
2020 MLaaS 產業介紹
samejack
0
70
Linux Container Introduction
samejack
0
40
Cloud Foundry Introduction
samejack
0
63
WordPress Blog SEO 兩三事
samejack
0
78
小猴子也會的 Ubuntu Desktop 14.04 安裝教學
samejack
0
120
軟體品質與持續整合
samejack
1
100
Other Decks in Programming
See All in Programming
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
210
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
140
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
430
Graviton と Nitro と私
maroon1st
0
160
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
170
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.5k
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
230
Grafana:建立系統全知視角的捷徑
blueswen
0
260
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
36k
愛される翻訳の秘訣
kishikawakatsumi
3
360
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Thoughts on Productivity
jonyablonski
73
5k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
96
How to make the Groovebox
asonas
2
1.9k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
0
980
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
260
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
54
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
89
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Faster Mobile Websites
deanohume
310
31k
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