caching-patterns

Implement HTTP, fragment, and Russian doll caching in Ruby on Rails.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/arthun01/achados-uesc --skill caching-patterns-arthun01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching-patterns
Source: https://github.com/arthun01/achados-uesc/tree/main/.opencode/skills/caching-patterns
Command: npx skills add https://github.com/arthun01/achados-uesc --skill caching-patterns-arthun01

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires solid_cache, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive caching strategies to optimize performance in Ruby on Rails applications, focusing on HTTP caching, fragment caching, and Solid Cache configuration.

Core Features & Use Cases

  • HTTP Caching: Implements HTTP caching with ETags, enabling 304 Not Modified responses for free.
  • Fragment Caching: Implements Russian doll caching for automatic cache invalidation and fragment caching in views.
  • Solid Cache: Utilizes Solid Cache for production caching, supporting database-backed caching without Redis.
  • Use Case: Use this Skill to enhance the performance of your Rails application by implementing caching layers, which can significantly reduce load times and server resource usage.

Quick Start

Run the caching patterns skill to apply HTTP caching with ETags to your Rails controller actions.

Frequently Asked Questions about caching-patterns

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

FAQPage Schema
How do I implement HTTP caching with ETags in Rails controllers?

You implement HTTP caching with ETags by adding them to your Rails controller actions, which enables the server to return 304 Not Modified responses when client data remains unchanged, significantly reducing bandwidth and server load.

What is Russian doll caching and how does it manage cache invalidation in Rails?

Russian doll caching is a fragment caching strategy that nests cached view fragments. It manages cache invalidation automatically by expiring parent fragments when underlying nested child fragments change, ensuring data consistency without manual expiration.

Do I need Redis to use Solid Cache for production caching in Rails 8?

You do not need Redis to use Solid Cache. Solid Cache provides database-backed caching for Rails 8.0+ production environments, utilizing your database directly instead of requiring an external memory store like Redis.

What are the requirements to set up Solid Cache and ETags in a Ruby on Rails application?

Setting up Solid Cache and ETags requires Ruby 3.3+, Rails 8.0+, and the solid_cache dependency. This environment supports the advanced caching layers and HTTP caching configurations needed for performance optimization.

When should I use fragment caching versus HTTP caching in Ruby on Rails?

Use fragment caching to cache specific parts of Rails views to reduce rendering time, and use HTTP caching with ETags to prevent sending unchanged data over the network. Combining both provides comprehensive performance optimization.