SSR vs CSR
We render 5000 accordion components
Timetime to see first content
SSR ~1,6s CSR ~3s



SSR

CSR



SSR

SSR + cache



Memory cache
import mcache from 'memory-cache';
const cache = (duration) => {
return (req, res, next) => {
const key = '__express__' + req.originalUrl || req.url;
const cachedBody = mcache.get(key);
if (cachedBody) {
res.send(cachedBody);
return;
} else {
res.sendResponse = res.send;
res.send = (body) => {
mcache.put(key, body, duration * 1000);
res.sendResponse(body);
};
next();
}
};
};
app.use(cache(10));
CSR

SSR



Mobile Chrome Android
Server-side caching approaches

SSR vs CSR
By Sergey Bolshov
SSR vs CSR
- 2,264