AI Briefing
KO

Kakao Makers Solves SSR Load with Next.js ISR and Redis External Caching

·2025.09.09 00:00

Key point

Achieved a 4.6x improvement in TPS and a 4x reduction in response time, with additional optimization via Nginx static resource serving.

1 / 10

Details

After migrating its event service to Next.js SSR, Kakao Makers experienced server failures due to sudden traffic spikes when sending KakaoTalk channel messages. To address this, they implemented ISR (Incremental Static Regeneration) and Redis external caching to reduce server load and improve performance.

ISR Implementation and Caching Strategy

ISR partially regenerates static pages on demand, providing both the performance of SSG and the flexibility of SSR. Kakao Makers used generateStaticParams to define static paths and set revalidate times to manage caches. Notably, ISR is disabled if dynamic APIs such as cookies or headers are included, so personalized data was separated to be handled on the client side.

Cache revalidation used a hybrid approach of time-based and on-demand methods. When CMS content was updated, revalidatePath was called to immediately invalidate the cache, and curl-based Prefetch logic pre-populated the cache before actual user requests to mitigate Thunder Herd issues. For security, the on-demand revalidation API was restricted to internal network IPs.

Redis Adoption and Production Environment Optimization

To resolve in-memory cache inconsistency issues between instances when running PM2 in cluster mode, Redis was introduced as an external shared cache. They used @neshca/cache-handler to connect Redis as a Next.js cache handler, enabling multiple instances to share the same cache data. Additionally, static resources were configured to be served directly by Nginx instead of a CDN, reducing network overhead and improving response speeds.

Performance Improvement Results and Future Challenges

These optimizations resulted in a 4.6x improvement in TPS and a 4x reduction in response time (MTT). Nginx static resource serving alone yielded a 28% improvement in TPS and a 36% reduction in response time. In the future, they plan to use Redis Pub/Sub to maintain in-memory cache performance while resolving cache synchronization issues, and to expand SSG generation at build time to address Thunder Herd issues during deployment.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.