Download the PHP package fofx/api-cache without Composer
On this page you can find all versions of the php package fofx/api-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fofx/api-cache
More information about fofx/api-cache
Files in fofx/api-cache
Package api-cache
Short Description Laravel-based API response caching library
License MIT
Informations about the package api-cache
API Cache Library
A Laravel-based PHP library for caching API responses from various services (OpenAI, DataForSEO, Pixabay, YouTube, and more). Provides intelligent caching, rate limiting, compression, and response management through a unified interface.
Requirements
- PHP 8.3+
- Laravel 11.38+
- Redis (for distributed rate limiting)
Development Setup
- Clone the repository
-
Install dependencies:
- Copy
.env.exampleto.env - For testing the demo API:
Documentation
Please see the docs folder for:
- Laravel Integration Guide - How to use this library in a full Laravel project
- Usage - Basic setup guide
- Database Migrations - Explanation of unconventional approach to database migrations
- Rate Limiting - Rate limiting with Redis
- Cloudflare Tunnel - Usage of Cloudflare Tunnel for local development
Diagrams
- Workflow Diagram
- Sequence Diagram
Features
- API response caching
- Rate limiting with Redis
- Compression support
- Multiple API client support
Caching Control
The sendCachedRequest() method respects the caching settings of the API client. You can control caching behavior using:
Rate Limiting
Redis-based distributed rate limiting is implemented to ensure consitent rate limiting across multiple application instances.
See Rate Limiting Documentation for details.
Database Migrations
This library takes an unconventional approach to database migrations in order to follow the DRY principle and simplify maintenance across multiple clients, while maintaining consistency between tables.
For more details, see Database Migrations Documentation.
Laravel Integration
To use this library in a full Laravel project, see the Laravel Integration Guide for step-by-step setup instructions including installation, configuration, and usage examples.
Usage
Getting Started
- Usage Introduction - Basic setup and usage guide
API Clients
- Jina AI
- OpenAI
- OpenPageRank
- OpenRouter
- Pixabay
- ScraperAPI
- ScrapingDog
- YouTube
DataForSEO API
- DataForSEO Setup
- DataForSEO Webhooks
- SERP Google Organic
- SERP Google Autocomplete
- Keywords Data Google Ads
- Labs
- Labs Google
- Merchant Amazon Products
- Merchant Amazon ASIN
- On Page
- Backlinks
- Backlinks Bulk
Utilities
- Responses Table Converters - Can be used to convert between compressed and uncompressed response tables
License
MIT
All versions of api-cache with dependencies
laravel/framework Version ^12.22
fofx/helper Version ^1.2
guzzlehttp/guzzle Version ^7.9
fofx/utility Version ^0.3.1
crunzphp/crunz Version ^3.8