PHPackages                             lukewaite/laravel-aws-cache-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. lukewaite/laravel-aws-cache-adapter

ActiveLibrary[Caching](/categories/caching)

lukewaite/laravel-aws-cache-adapter
===================================

Laravel Cache Adapter for AWS Credential Caching. Allows you to reduce calls to the ec2 metadata api.

v1.1.1(7y ago)525.4k4MITPHPCI failing

Since Apr 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lukewaite/laravel-aws-cache-adapter)[ Packagist](https://packagist.org/packages/lukewaite/laravel-aws-cache-adapter)[ RSS](/packages/lukewaite-laravel-aws-cache-adapter/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (7)Versions (7)Used By (0)

laravel-aws-cache-adapter
=========================

[](#laravel-aws-cache-adapter)

> Provides an `Aws\CacheInterface\CacheInterface` compliant cache for the AWS SDK which uses the laravel Cache classes.

[![Latest Version on Packagist](https://camo.githubusercontent.com/231082354f5c9117d749c5f18531c1ae0c0fcca81cb3041e47740e45e9708c18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukewaite/laravel-aws-cache-adapter)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/fd7f4d9c1f40bae0817c1b7c4b54cae4d5b640d2b4358ec2273723c231aea610/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lukewaite/laravel-aws-cache-adapter)[![Code Coverage](https://camo.githubusercontent.com/4b3465842713b85c7559f19ac3b8b44f850434cf7a74411ea3ffe1135528eaed/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lukewaite/laravel-aws-cache-adapter/?branch=master)

### Purpose

[](#purpose)

When using EC2 Instance IAM Roles or ECS Task IAM Roles the AWS php sdk automatically performs lookups against the ec2 metadata api (169.254.169.254) to get credentials. These by default are not cached, and can occasionally be a source of trouble or slowdowns if the metadata api is slow/not responding.

This package allows you to configure certain laravel filesystems to be automatically loaded with a `CacheInterface` that will use a laravel cache store to cache the STS tokens returned, reducing requests to the metadata api.

Usage
=====

[](#usage)

### Direct Usage of the Adapter

[](#direct-usage-of-the-adapter)

The `LaravelCacheAdapter` can be passed directly into Flysystem in your `config/filesystems.php`

```
    's3' => [
        'driver'      => 's3',
        'base-path'   => 'https://s3.amazonaws.com',
        'credentials' => new LaravelCacheAdapter(app('cache'))
        'bucket'      => env('AWS_BUCKET'),
        'region'      => env('AWS_REGION', 'us-east-1'),
    ],

```

### Auto Insertion of the CredentialProvider via ServiceProvider

[](#auto-insertion-of-the-credentialprovider-via-serviceprovider)

The default configuration settings are in `/config/laravel-aws-cache.php`. Copy this file to your own config directory to modify the values. You can publish this config using this command:

```
$ php artisan vendor:publish --provider="LukeWaite\LaravelAwsCacheAdapter\ServiceProvider"

```

#### Configuration

[](#configuration)

```
return [
    /**
     * A comma separated list of filesystems defined in `config/filesystems.php` to which the
     * credential cache should be applied.
     */
    'filesystems' => env('LARAVEL_AWS_CACHE_FILESYSTEMS', null),

    /**
     * Whether or not to iterate through the `filesystems` defined and apply the credential cache.
     */
    'enable' => env('LARAVEL_AWS_CACHE_ENABLE', false),

    /**
     * The Laravel cache store defined in `config/cache.php` to use.
     */
    'cache' => env('LARAVEL_AWS_CACHE_CACHE', 'file')
];

```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~248 days

Total

4

Last Release

2608d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/134ccfc3c0d62a251b2df558f57ac2ebc918d45bc95235acd2b60ba7f251bad1?d=identicon)[lukewaite](/maintainers/lukewaite)

---

Top Contributors

[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (16 commits)")

---

Tags

awsaws-php-sdkiamlaravelphplaravelawscacheiamcredential

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lukewaite-laravel-aws-cache-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/lukewaite-laravel-aws-cache-adapter/health.svg)](https://phpackages.com/packages/lukewaite-laravel-aws-cache-adapter)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

13314.7k](/packages/nexxai-laravel-cfcache)[kolay/xlsx-stream

Streaming XLSX reader and writer for PHP and Laravel. Constant memory regardless of file size, direct S3 multipart streaming, optional born-indexed random access.

437.9k](/packages/kolay-xlsx-stream)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
