{"repo":"ezeparziale/nextjs-k8s","free":true,"listed":false,"github":"https://github.com/ezeparziale/nextjs-k8s","clone":"git clone https://github.com/ezeparziale/nextjs-k8s.git","description":":whale: Next.js app with 2 pods sharing cache on redis","language":"TypeScript","stars":155,"topics":["cache","docker","kubernetes","nextjs","redis","docker-compose","pod","standalone","vps"],"license":null,"category":"deployment-docker-iac","readme_excerpt":":zap: Next.js 16 + ValKey/Redis cache + Kubernetes Next.js web application with 2 pods sharing cache. [!NOTE] You can also check the other branches for Next.js 14 ( main-14 ), Next.js 15 ( main-15 ) or Redis Strings ( redis-strings ) as there are variants that may also be useful to you. :speech balloon: About this repo :whale: Docker I created the Docker image following the example in: I configured the output: \"standalone\" property in next-config.ts . More info at: :card file box: Cache I use ValKey to cache values and ensure consistency across all pods. I installed custom handler using npm install @mrjasonroy/cache-components-cache-handler : More info at: I added cache-handler.mjs and configured the cacheHandlers property in next.config.ts . Additionally, I enabled cacheComponents: true to cache the rendered components. I followed this example and the same pages to validate the cache using use cache , cacheTag , cacheLife , updateTag and revalidatePath . [!WARNING] Only Next.js 16 + cacheComponents supports these features. [!WARNING] CacheHandlers (with S) is different than CacheHandler (without S). More info at: :whale2: Kubernetes In the k8s folder, there are all the Kubernetes manifests to create two pods with the Next.js web application and one pod with a Redis server. :runner: Run :1st place medal: Option 1 Run in dev mode with npm run dev . :2nd place medal: Option 2 Run in Docker using Docker Compose with docker compose -f \"compose.yaml\" up -d --build . :3rd place med","default_branch":null,"files":null,"tree":[],"storefront":"/r/ezeparziale","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ezeparziale/nextjs-k8s/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}