Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HTML5 Application Caching
Search
Ryan McGeary
February 05, 2012
Technology
4
1.1k
HTML5 Application Caching
Ryan McGeary
February 05, 2012
Tweet
Share
More Decks by Ryan McGeary
See All by Ryan McGeary
Cloud Services You Should Be Using To Build Your Startup
rmm5t
1
700
Asynchronous Collaboration
rmm5t
5
1.3k
How We Use MongoDB at BusyConf (Take Two!)
rmm5t
2
160
Just In Time Inventory with Spree
rmm5t
3
1.8k
How We Use MongoDB at BusyConf
rmm5t
2
730
CoffeeScript
rmm5t
5
710
One Man Lightning Talks
rmm5t
2
420
Do Your Commit Messages Suck?
rmm5t
5
1.9k
Other Decks in Technology
See All in Technology
.NET 10 のパフォーマンス改善
nenonaninu
2
4.7k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
37k
20251127 BigQueryリモート関数で作る、お手軽AIバッチ実行環境
daimatz
0
430
シンプルを極める。アンチパターンなDB設計の本質
facilo_inc
1
1k
その設計、 本当に価値を生んでますか?
shimomura
2
180
Security Diaries of an Open Source IAM
ahus1
0
110
GitLab Duo Agent Platformで実現する“AI駆動・継続的サービス開発”と最新情報のアップデート
jeffi7
0
140
Design System Documentation Tooling 2025
takanorip
1
920
著者と読み解くAIエージェント現場導入の勘所 Lancers TechBook#2
smiyawaki0820
7
2.8k
Master Dataグループ紹介資料
sansan33
PRO
1
4k
私のRails開発環境
yahonda
0
180
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
120
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Building Adaptive Systems
keathley
44
2.9k
Fireside Chat
paigeccino
41
3.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Balancing Empowerment & Direction
lara
5
780
For a Future-Friendly Web
brad_frost
180
10k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
It's Worth the Effort
3n
187
29k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Typedesign – Prime Four
hannesfritz
42
2.9k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Transcript
HTML5 Application Caching There are only two hard things in
Computer Science: cache invalidation and naming things. -- Phil Karlton Ryan McGeary http://ryan.mcgeary.org @rmm5t
diveintohtml5.info
Browser Support
Cache Manifest <!DOCTYPE HTML> <html manifest="/mobile.manifest"> <body> ... </body> </html>
text/cache-manifest
CACHE Sections CACHE MANIFEST http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js /stylesheets/screen.css /data.json
NETWORK Sections CACHE MANIFEST NETWORK: * CACHE: http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js
/stylesheets/screen.css /data.json
FALLBACK Sections CACHE MANIFEST FALLBACK: / /offline.html NETWORK: * CACHE:
http://www.google-analytics.com/ga.js /favicon.ico
Expiring The Cache CACHE MANIFEST # Updated: <%= something.updated_at %>
# Released: <%= application_released_at %> NETWORK: * CACHE: # ...
window.applicationCache swapCache() checking downloading progress cached error updateready already cached?
NO YES updated manifest? noupdate NO YES
window.applicationCache.status 0: window.applicationCache. UNCACHED 1: window.applicationCache. IDLE 2: window.applicationCache. CHECKING
3: window.applicationCache. DOWNLOADING 4: window.applicationCache. UPDATEREADY 5: window.applicationCache. OBSOLETE
Debugging Tips about:about
Debugging Tips https://gist.github.com/1714753
Debugging Tips or Use:
Gotchas! #1 The manifest is downloaded twice during a sync.
Gotchas! #2 Beware of swapCache
Gotchas! #3 Make sure your manifest file isn’t cached.
DEMO Let’s play some music.
Ryan McGeary ryan.mcgeary.org @rmm5t
[email protected]
McGeary Consulting Group