Skip to content

Using a Decorator pattern to cache data returned by repositories

Notifications You must be signed in to change notification settings

koomai/repository-cache-decorator

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published