PHPackages                             vormkracht10/laravel-permanent-cache - 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. vormkracht10/laravel-permanent-cache

Abandoned → [backstagephp/laravel-permanent-cache](/?search=backstagephp%2Flaravel-permanent-cache)Library[Caching](/categories/caching)

vormkracht10/laravel-permanent-cache
====================================

Using Laravel Permanent Cache you can cache intensive operations permanently and update them in the background, so your users don't have to wait!

v4.0.1(1mo ago)61.7k[1 PRs](https://github.com/backstagephp/laravel-permanent-cache/pulls)MITPHPPHP ^8.1CI passing

Since Apr 21Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/backstagephp/laravel-permanent-cache)[ Packagist](https://packagist.org/packages/vormkracht10/laravel-permanent-cache)[ Docs](https://github.com/backstagephp/laravel-permanent-cache)[ GitHub Sponsors](https://github.com/backstagephp)[ RSS](/packages/vormkracht10-laravel-permanent-cache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (30)Versions (187)Used By (0)

Laravel Permanent Cache
=======================

[](#laravel-permanent-cache)

[![Total Downloads](https://camo.githubusercontent.com/0a1f5af2dc7e6dfdb7b63f438bfa0afb1dede8da447dd503f802426a1ff0503e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b73746167652f6c61726176656c2d7065726d616e656e742d63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backstage/laravel-permanent-cache)[![Tests](https://github.com/backstagephp/laravel-permanent-cache/actions/workflows/pest.yml/badge.svg?branch=main)](https://github.com/backstagephp/laravel-permanent-cache/actions/workflows/run-tests.yml)[![PHPStan](https://github.com/backstagephp/laravel-permanent-cache/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/backstagephp/laravel-permanent-cache/actions/workflows/phpstan.yml)[![GitHub release (latest by date)](https://camo.githubusercontent.com/478ee769fce216aeee73f1cbbbfc4697a7b782e9d091870d76c379b1a3c69191/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6261636b73746167657068702f6c61726176656c2d7065726d616e656e742d6361636865)](https://camo.githubusercontent.com/478ee769fce216aeee73f1cbbbfc4697a7b782e9d091870d76c379b1a3c69191/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6261636b73746167657068702f6c61726176656c2d7065726d616e656e742d6361636865)[![Packagist PHP Version Support](https://camo.githubusercontent.com/bc879d96dc95c774a6bb5400d347e4327278b9c3c9da860f55ec9371b07a57c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6261636b73746167652f6c61726176656c2d7065726d616e656e742d6361636865)](https://camo.githubusercontent.com/bc879d96dc95c774a6bb5400d347e4327278b9c3c9da860f55ec9371b07a57c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6261636b73746167652f6c61726176656c2d7065726d616e656e742d6361636865)[![Latest Version on Packagist](https://camo.githubusercontent.com/7c88c1cf33b313790b4822db44c5c7056a09f258ef8654af046f0cba05d32428/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b73746167652f6c61726176656c2d7065726d616e656e742d63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backstage/laravel-permanent-cache)

This package aims to provide functionality of using a *permanent* cache for tasks using heavy Eloquent models, database queries or other long running tasks in your Laravel app. The permanent cache updates itself in the background using a scheduled task or by listening to an event so no users are harmed waiting on a given request.

Its use case is primarily to be used for heavy tasks that should return complex data or HTML for the front-end that does not need to be realtime but still regularly updated. Think about external API calls that take a few seconds to process or other 1+ second tasks.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require backstage/laravel-permanent-cache
```

Optionally, publish config files to change the default config:

```
php artisan vendor:publish --provider="Backstage\PermanentCache\Laravel\PermanentCacheServiceProvider"
```

The default config options:

```
