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, why not?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
dkovalenko
July 11, 2015
Technology
88
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Caching, why not?
Highload meetup: talks by Megogo, 2015
dkovalenko
July 11, 2015
Other Decks in Technology
See All in Technology
ブラウザ研修 2026
recruitengineers
PRO
6
930
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
720
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
サイバー捜査員研修(前半)
nomizone
1
2k
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
280
Pavlokで始める電撃駆動開発
sgrsn
0
190
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
20分でわかるセキュアAPI
nwiizo
2
250
ホームラボ紹介
y_sera15
0
150
Model Studio CLI × Token Plan
maigo999
0
150
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.5k
強化学習「理論」入門
enakai00
3
3.6k
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
270
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
330
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
340
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Writing Fast Ruby
sferik
630
63k
Building AI with AI
inesmontani
PRO
1
1.1k
Tell your own story through comics
letsgokoyo
1
1k
Transcript
Caching, why not? Highload Meetup: talks by Megogo
About me • Dmitriy Kovalenko @dkovalenko_fun • TeamLead @ x2sy:
Megogo • Actively using: Scala, php • Also: Clojure, golang
About us • > 4 million users every day •
> 30000 hours of video content • Web, iOS, Android, SmartTV, OTT Boxes • CIS, Baltics, Europe
Agenda • Caching across tiers: 1. Browser 2. Frontend server/proxy
3. Application • Cache infrastructure • Microservices and caching
Speedup your Application
None
None
• Cache-control • Max-Age, S-Max-Age (seconds) • Expires • ETag
(If-None-Match) Headers
None
Use CDN, Carl! • Move your Images, JS, CSS ->
CDN • Assets minifying, response gzipping
Use your Frontend/ Cacher/ Proxy
Reverse proxy • Varnish Cache • Nginx • Use your
cache store directly (CouchDB, Memcached) • Split your page, think about SSI/ESI includes
None
frontend server caching pros: • High speed • Zero overhead
for application • Usually can be applied without application change
frontend server caching cons: • Hard to debug • Hard
to get right • Changes in application needs additional synchronization
Application cache pros: • Much controllable than frontend cache •
Can use Application context • Swapping implementations in not a problem
Problems to think about • Key selection, Cache Tags •
Invalidation schema • Cold start/full flush • Dogpile effect • Embedded or External • Local or Distibuted
<?php $data = $cache->get('some_key'); if ($data === false) { $data
= getFromDB(); $cache->set($data); } return $data;
Cache slam problem
Eviction strategies • LRU • LFU • FIFO • Lifetime
Cache in cluster CP DB Service 2 WEB API Service
2
Going further with Microservices
There are only two hard things in Computer Science: cache
invalidation and naming things. ! -- Phil Karlton
Solutions • Nodes list • Shared/Distributed caches • Master invalidates
slaves • Queue • Cache cleaner • ETag FTW!
None
None
None
None
None
None
Great caching is like great sex. It hides all the
real problems. ! @vivekhaldar Questions?