A Rails gem providing action-level caching that runs through the full controller stack, allowing authentication and filters.
ActionPack Action Caching is a Ruby gem that provides action-level caching for Rails applications. It caches the entire output of controller actions while still processing requests through the full Rails stack, solving the problem of caching pages that require authentication or other pre-processing logic. This approach offers performance benefits similar to page caching but with the flexibility of running controller filters.
Rails developers building applications that need to cache dynamic pages while maintaining authentication, authorization, or other controller-level logic. Particularly useful for applications with authenticated user sections that still benefit from caching.
Developers choose this gem because it restores a crucial caching strategy removed from Rails core, offering better performance than fragment caching for full pages while maintaining security through controller filters. Its flexible configuration options and support for multi-tenant applications make it a versatile caching solution.
Action caching for Action Pack (removed from core in Rails 4.0)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures authentication and before_action filters run before caching, allowing secure caching of protected pages as shown in the README's authentication example.
Offers :cache_path options with procs, :if/:unless conditions, and :expires_in for time-based expiration, providing granular control over caching logic.
Automatically names cache fragments by host and path, supporting subdomain-based account patterns without extra configuration.
Treats different representations like HTML, XML, and JSON as separate cache entries, preventing content negotiation issues in APIs.
Relies on restoring functionality removed from Rails 4.0, which may lead to compatibility gaps or less active maintenance compared to built-in Rails caching.
Requires explicit expiration handling and custom cache paths, increasing complexity in dynamic applications with frequent updates.
Every request still processes through Action Pack, adding overhead compared to page caching, which skips the controller entirely.