From 54b935d748fb1984e434e4ae807cdb0d64d399cb Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 19 Jun 2022 13:50:08 +0200 Subject: [PATCH] Add info on automatic cache invalidation I spent some time to find out how to manually invalidate the cache, when during testing I found out this is already handled in the base Tenant model. Adding this small paragraph might help others. --- source/docs/v3/cached-lookup.blade.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/docs/v3/cached-lookup.blade.md b/source/docs/v3/cached-lookup.blade.md index babc411..993ee00 100644 --- a/source/docs/v3/cached-lookup.blade.md +++ b/source/docs/v3/cached-lookup.blade.md @@ -30,4 +30,8 @@ DomainTenantResolver::$cacheTTL = 3600; // specify some cache store // null resolves to the default cache store DomainTenantResolver::$cacheStore = 'redis'; -``` \ No newline at end of file +``` + +## Cache invalidation + +Updating and saving a Tenant model's attributes will cause the cached entry for this model to be invalidated when `DomainTenantResolver::$shouldCache` is set to `true`.