Page caching - Maximizing Performance with HTTP Caching: A Comprehensive Guide

HTTP caching is a powerful technique for optimizing web performance and reducing server load. In this comprehensive guide, we’ll explore the fundamentals of HTTP caching, its benefits, implementation strategies, and best practices to help you harness its full potential.

March 23, 2024 · 3 min · 523 words · Bá Tới

Cache avalanche, Cache breakdown, Cache Stampede and Cache Penetration

In this article, we explore the concepts of cache avalanche, cache breakdown, and cache penetration, common issues that can affect the performance of caching systems. We discuss the causes of these problems, their impact on system performance, and strategies to mitigate their effects.

March 23, 2024 · 7 min · 1332 words · Bá Tới

Page caching - Combining Page Caching in Rails with Nginx Memory Caching

Rails page caching and nginx make a natural pair: nginx serves the HTML files Rails writes to public/ straight from disk, and its proxy cache (stored on disk, indexed in shared memory) holds every other public response. In this guide, we’ll configure both, with a safe cache key, session-cookie bypass, cache locking and stale serving.

August 7, 2021 · Updated October 29, 2026 · 6 min · 1116 words · Bá Tới

Page caching - Implementing Page Caching in a Rails Application with Redis

Serving whole pages from a shared cache breaks Rails forms, because every visitor receives the CSRF token that was rendered for someone else. In this post, we’ll cache public pages with Rack::Cache backed by Redis and look at two ways to keep CSRF tokens working: fetching a fresh token with JavaScript from a small uncached endpoint, and a Rack middleware that injects one on the server.

August 6, 2021 · Updated October 29, 2026 · 9 min · 1714 words · Bá Tới

Page caching - Leveraging Page Caching with Varnish in Rails Applications

Varnish can cache whole Rails pages in memory and serve them without touching the application, but only if Rails tells it which pages are safe to share. In this article, we’ll let Rails mark public pages with Cache-Control, configure Varnish to honour those headers without leaking one user’s page to another, and add PURGE/BAN invalidation.

August 5, 2021 · Updated October 29, 2026 · 7 min · 1314 words · Bá Tới

Page caching - Strategies for Web Performance Optimization

Page caching is a technique used to improve the performance of web applications by storing the entire HTML output of a page and serving it directly from the cache for subsequent requests. This eliminates the need to generate the page dynamically on each request, reducing server load and improving response times. In this article, we’ll explore the concept of page caching, the HTTP caching basics it relies on, and the main places a full page can be cached, plus related techniques that cache smaller pieces.

August 4, 2021 · Updated October 29, 2026 · 6 min · 1074 words · Bá Tới

Using Redis in Rails Applications

Redis is an in-memory data structure store known for its speed and flexibility. It serves as a high-performance database, cache, and message broker, offering data structures such as strings, hashes, lists, sets, and sorted sets. This article covers how Rails applications use Redis for caching, sessions, background jobs and counters, how to set up Rails’ built-in Redis cache store, and when Rails 8’s database-backed defaults make Redis optional.

April 7, 2021 · Updated October 29, 2026 · 4 min · 798 words · Bá Tới