Download the PHP package iprodev/php-easycache without Composer

On this page you can find all versions of the php package iprodev/php-easycache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-easycache

PHP EasyCache v3 — PSR‑16 Multi‑Backend Cache with SWR

EasyCache is a pragmatic, batteries‑included cache library that implements the PSR‑16 Simple Cache interface and adds production‑grade features on top:

Version: v3.0.1 — Requires PHP 8.1+ and psr/simple-cache:^3.

📖 Documentation in other languages:


📦 Installation

Optional dependencies


🚀 Quick Start (PSR‑16)


🎯 Core Features

1. Multi-Tier Caching

Organize your cache in tiers from fastest to slowest. The library automatically:

2. Stale-While-Revalidate (SWR)

When data expires but is still inside the SWR window, stale data is served instantly while a refresh happens in the background. This prevents cache stampedes and ensures fast response times.

How it works:

  1. If data is fresh, it's returned immediately
  2. If data is expired but within SWR window:
    • Stale data is returned instantly
    • Background refresh is triggered (non-blocking)
  3. If refresh fails, stale data continues to be served (within staleIfError window)

3. Pluggable Serialization

Choose the serializer that fits your needs:

4. Pluggable Compression

Save memory and disk space:


💾 Storage Backends

APCu Storage

Fast in-memory cache, perfect as the first tier.

Features:

Redis Storage

Network-based cache with persistence options.

Features:

File Storage

Reliable disk-based cache with sharding.

Features:

Directory Sharding Example:

PDO Storage

SQL database cache for shared environments.

Supported databases:

Features:


🎨 Complete Examples

Example 1: Simple File Cache

Example 2: Multi-Tier with Backfill

Example 3: SWR for API Responses

Example 4: Batch Operations

Example 5: DateInterval TTL

Example 6: Custom Logger Integration

Example 7: Scheduled Cleanup


🎭 Laravel Integration

Setup

  1. Install the package:

  2. Publish configuration:

  3. Configure in config/easycache.php:

Using the Facade

Artisan Commands

The package includes a prune command:


🔑 Key Rules (PSR‑16)


🧪 Testing & Quality Assurance

Running Tests

Static Analysis

Test Coverage

The library includes comprehensive tests for:


🔧 Advanced Configuration

Custom Lock Path

File Storage Sharding Levels

Environment Variables (Laravel)


🚨 Error Handling

All storage operations are wrapped with proper error handling. Failures are logged (if logger is provided) and don't crash your application:

Logged Events:


🔄 Backwards Compatibility

For projects upgrading from v2, use the BC wrapper:


📝 Best Practices

  1. Use multi-tier wisely: APCu → Redis → File/PDO
  2. Set appropriate TTLs: Balance freshness vs. performance
  3. Use SWR for expensive operations: Prevent cache stampedes
  4. Monitor cache hit rates: Use logging to track performance
  5. Schedule pruning: For PDO storage, prune regularly
  6. Use compression for large data: GzipCompressor or ZstdCompressor
  7. Namespace your keys: Use prefixes to avoid collisions
  8. Test error scenarios: Ensure your app handles cache failures gracefully

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Development Setup


📄 License

MIT © iprodev


🔗 Links


💬 Support


All versions of php-easycache with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/simple-cache Version ^3.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iprodev/php-easycache contains the following files

Loading the files please wait ...