$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Caching, why not?
Search
dkovalenko
July 11, 2015
Technology
1
75
Caching, why not?
Highload meetup: talks by Megogo, 2015
dkovalenko
July 11, 2015
Tweet
Share
Other Decks in Technology
See All in Technology
[CMU-DB-2025FALL] Apache Fluss - A Streaming Storage for Real-Time Lakehouse
jark
0
120
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
160
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
780
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
3.2k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2025/09 - 2025/11
oracle4engineer
PRO
0
140
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
500
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
1
170
AWSを使う上で最低限知っておきたいセキュリティ研修を社内で実施した話 ~みんなでやるセキュリティ~
maimyyym
2
1.5k
MLflowで始めるプロンプト管理、評価、最適化
databricksjapan
1
250
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
130
Microsoft Agent 365 についてゆっくりじっくり理解する!
skmkzyk
0
340
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
7
1.6k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
How to Ace a Technical Interview
jacobian
281
24k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Balancing Empowerment & Direction
lara
5
800
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
The Language of Interfaces
destraynor
162
25k
KATA
mclloyd
PRO
33
15k
Typedesign – Prime Four
hannesfritz
42
2.9k
Designing for Performance
lara
610
69k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.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?