Download the PHP package fyennyi/async-cache-php without Composer

On this page you can find all versions of the php package fyennyi/async-cache-php. 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 async-cache-php

Async Cache PHP

Latest Stable Version Total Downloads License Tests Test Coverage Static Analysis

An asynchronous caching abstraction layer for PHP with built-in rate limiting and stale-while-revalidate support. This library is designed to wrap promise-based operations (like ReactPHP Promises) to provide robust caching strategies suitable for high-load or rate-limited API clients.

Features

Installation

To install the Async Cache PHP library, run the following command in your terminal:

Usage

Basic Setup

The easiest way to create a manager is using the fluent configuration API.

Wrapping an Async Operation

Use the wrap method to cache a promise-based operation.

Advanced Configuration Options

The CacheOptions DTO allows you to configure behavior per request:

Atomic Increments

How It Works

  1. Cache Hit: If data is found in the cache and is fresh (within ttl), the promise resolves immediately with the cached value. The factory function is not called.
  2. Cache Miss: If data is not found, the factory function is executed, and the result is stored in the cache.
  3. Stale Data:
    • If data is in the cache but expired (older than ttl), the manager behavior depends on the chosen strategy.
    • Strict: Fetches fresh data while the request waits.
    • Background: Returns stale data immediately and triggers an asynchronous refresh in the background.
  4. X-Fetch: Helps avoid simultaneous cache misses for the same key by probabilistic early recomputation.

Contributing

Contributions are welcome and appreciated! Here's how you can contribute:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please make sure to update tests as appropriate and adhere to the existing coding style.

License

This library is licensed under the CSSM Unlimited License v2.0 (CSSM-ULv2). See the LICENSE file for details.


All versions of async-cache-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/clock Version ^1.0
psr/event-dispatcher Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
react/async Version ^4.3
react/cache Version ^1.2
react/promise-timer Version ^1.11
symfony/clock Version ^6.3
symfony/lock Version ^6.0 || ^7.0 || ^8.0
symfony/rate-limiter Version ^6.0 || ^7.0 || ^8.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 fyennyi/async-cache-php contains the following files

Loading the files please wait ...