Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. Stash

Stash

BSD-3-ClausePHPv1.2.2

A PHP caching library that speeds up code by storing results of expensive operations like database queries and API calls.

Visit WebsiteGitHubGitHub
961 stars130 forks0 contributors

What is Stash?

Stash is a PHP caching library designed to accelerate applications by caching the results of time-consuming operations, such as database queries or external API calls. It helps improve performance by storing and retrieving data from various backend systems, reducing the need to repeatedly execute expensive functions.

Target Audience

PHP developers building applications that require performance optimization through caching, particularly those using frameworks like Symfony or needing flexible backend support.

Value Proposition

Developers choose Stash for its clean abstraction over multiple caching backends, support for composite multi-tiered drivers, and built-in features like session handling and Symfony integration, offering simplicity and flexibility in cache management.

Overview

The place to keep your cache.

Use Cases

Best For

  • Caching results of expensive database queries to reduce load times in PHP applications.
  • Storing and retrieving external API call results to minimize latency and rate limiting.
  • Implementing multi-tiered caching systems using composite drivers with various backends like FileSystem, Redis, or Memcached.
  • Managing session storage in PHP applications with a dedicated session handler class.
  • Integrating caching into Symfony projects via the Stash Bundle for seamless service usage.
  • Organizing cached data with slash-separated keys and stacks for easy bulk operations and maintenance.

Not Ideal For

  • Projects requiring automatic cache invalidation with tagging, as Stash relies on manual key-based stacks.
  • Teams using Laravel or other frameworks with built-in caching solutions that prefer zero-configuration integration.
  • High-scale applications needing distributed caching with built-in replication and failover mechanisms.

Pros & Cons

Pros

Multiple Backend Drivers

Supports FileSystem, SQLite, APC, Memcached, Redis, and Ephemeral drivers, allowing seamless integration with various caching systems as listed in the README.

Composite Caching Layers

The Composite Driver enables multi-tiered caching by combining different backends, optimizing for both speed and persistence based on application needs.

Structured Key Organization

Uses slash-separated keys with stacks for grouping related items, facilitating easy bulk operations and maintenance, as highlighted in the core concepts.

Symfony Integration

Offers a dedicated bundle for Symfony, making it easy to use Stash as a service and session handler within Symfony projects, reducing setup effort.

Cons

Pre-1.0 API Instability

The library is still pre-version 1.0, so minor updates may include breaking changes that require manual review, as cautioned in the Composer installation notes.

Manual Configuration Overhead

Setting up drivers and pools requires explicit code, which can be complex and time-consuming compared to framework-native caching solutions.

Limited Advanced Features

Lacks built-in support for cache tagging or sophisticated invalidation strategies beyond key-based stacks, which may hinder complex cache management.

Frequently Asked Questions

Quick Stats

Stars961
Forks130
Contributors0
Open Issues34
Last commit4 months ago
CreatedSince 2011

Tags

#filesystem#caching#redis#symfony-bundle#sqlite#php#caching-library#memcached#performance

Built With

P
PHP

Links & Resources

Website

Included in

PHP32.5k
Auto-fetched 5 hours ago

Related Projects

Doctrine CacheDoctrine Cache

Doctrine Cache component

Stars7,877
Forks212
Last commit6 months ago
CacheToolCacheTool

CLI App and library to manage apc & opcache.

Stars1,807
Forks155
Last commit3 months ago
LockLock

Popular PHP library for serialized execution of critical code in concurrent situations

Stars945
Forks93
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub