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
dkovalenko
July 11, 2015
Technology
81
1
Share
Caching, why not?
Highload meetup: talks by Megogo, 2015
dkovalenko
July 11, 2015
Other Decks in Technology
See All in Technology
自分をひらくと次のチャレンジの敷居が下がる
sudoakiy
5
1.8k
サイボウズフロントエンドの活動から考える探究と発信
mugi_uno
0
110
Babylon.js Japan Activities (2026/4)
limes2018
0
170
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
13
7.5k
ZOZOTOWNリプレイスでのSkills導入までの流れとこれから
zozotech
PRO
2
2.2k
OpenClaw初心者向けセミナー / OpenClaw Beginner Seminar
cmhiranofumio
0
300
不確実性と戦いながら見積もりを作成するプロセス/mitsumori-process
hirodragon112
1
180
主催・運営として"場をつくる”というアウトプットのススメ
_mossann_t
0
100
OpenClawでPM業務を自動化
knishioka
2
390
チームで育てるAI自走環境_20260409
fuktig
0
620
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
270
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
380
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
880
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
470
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.3k
エンジニアに許された特別な時間の終わり
watany
106
240k
Ethics towards AI in product and experience design
skipperchong
2
250
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
170
The Limits of Empathy - UXLibs8
cassininazir
1
280
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
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?