koomai / repository-cache-decorator

Using a Decorator pattern to cache data returned by repositories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repository Cache Decorator

This is a sample Laravel app to demonstrate the use of a Decorator pattern to implement caching for repositories.

Usage

1. composer install
2. php artisan migrate
3. php artisan db:seed

Check the Repositories directory and RepositoryServiceProvider for implementation details.

Note

Invalidating caches in the file or database is a bit clunky because you cannot use Laravel's tagging feature for caches.

You would use Cache Tags for Redis or Memcached drivers.

About

Using a Decorator pattern to cache data returned by repositories


Languages

Language:PHP 96.2%Language:HTML 3.2%Language:Vue 0.7%