37signals-caching

Implement HTTP, fragment, Russian doll, and low-level caching in Rails apps.

1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-caching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 37signals-caching
Source: https://github.com/joshyorko/agent-skills/tree/main/plugins/rails-37signals-patterns/skills/37signals-caching
Command: npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-caching

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implements aggressive caching strategies in Rails applications to dramatically reduce response times, minimize database load, and improve user experience by leveraging HTTP caching, fragment caching, Russian doll caching, and a database-backed Solid Cache in production.

Core Features & Use Cases

  • HTTP caching with ETags and conditional GET for free 304 responses
  • Russian doll (nested) fragment caching with automatic invalidation via touch: true
  • Fragment caching in views with cache keys tied to updated_at timestamps
  • Collection caching and advanced cache_key_with_version strategies
  • Low-level Rails.cache.fetch usage for expensive computations
  • Solid Cache integration for database-backed caching in production
  • Clear cache invalidation patterns and sweepers for complex dependencies

Quick Start

Configure a Rails app to cache aggressively using HTTP ETags, Russian doll and fragment caching, with Solid Cache in production and proper invalidation.

Frequently Asked Questions about 37signals-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement HTTP caching and ETags in a multi-tenant Rails application?

Implement HTTP caching in multi-tenant Rails by using ETags and conditional GETs for free 304 responses, ensuring cache keys include updated_at timestamps and maintain strict per-account scoping to isolate tenant data securely.

What is the best way to handle cache invalidation with ActiveRecord associations in Rails?

Handle Rails cache invalidation by using Russian doll fragment caching with touch: true on ActiveRecord associations, ensuring cache keys tied to updated_at timestamps automatically expire when associated parent or child records change.

Can I use Solid Cache for database-backed caching in production instead of Redis?

Yes, you can use Solid Cache for database-backed caching in production instead of Redis, leveraging it to store HTTP responses and fragment caches while satisfying strict guidelines for safe defaults and cache expiration.

When do I need low-level Rails.cache.fetch for expensive computations?

Use low-level Rails.cache.fetch for expensive computations when fragment or HTTP caching is insufficient, wrapping complex logic with cache_key_with_version strategies to ensure proper invalidation and avoid stale data.

Does Russian doll caching work with collection caching in Rails views?

Yes, Russian doll caching works seamlessly with collection caching in Rails views, allowing nested fragments to reuse cached records efficiently while relying on touch-based invalidation and updated_at versions for automatic expiration.