OMNI Access
v1.3.0
Free
~10 min read
Caching Roles & Permissions
How OMNI Access caches role and permission lookups, the CacheService API, and how to invalidate or clear cached data.
01
Step 1 of 4
Overview
OMNI Access includes basic caching to improve performance.
02
Step 2 of 4
Cache Configuration
// config/omni-access.php
'cache' => [
'enabled' => true,
'expiration_time' => 60 * 24, // 24 hours in minutes
'key_prefix' => 'omni_access',
]
// config/omni-access.php
'cache' => [
'enabled' => true,
'expiration_time' => 60 * 24, // 24 hours in minutes
'key_prefix' => 'omni_access',
]
03
Step 3 of 4
Clear Cache
# Clear all OMNI Access cache
php artisan omni-access:clear-cache --all
# Clear specific user cache
php artisan omni-access:clear-cache --user=1
# Clear specific role cache
php artisan omni-access:clear-cache --role=2
# Clear all OMNI Access cache
php artisan omni-access:clear-cache --all
# Clear specific user cache
php artisan omni-access:clear-cache --user=1
# Clear specific role cache
php artisan omni-access:clear-cache --role=2
04
Step 4 of 4
Programmatic Cache Management
// Clear all RBAC cache
app('omni-access')->clearCache();
// Refresh user permissions cache
$user->refreshPermissionsCache();
// Manual cache operations
$cache = app(CacheService::class);
$cache->forgetUser($userId);
$cache->forgetRole($roleId);
$cache->flush();
PRO Feature: Smart caching with Redis tags, automatic warm-up, and intelligent invalidation is available in PRO. Upgrade for better performance → (
#comparison)
// Clear all RBAC cache
app('omni-access')->clearCache();
// Refresh user permissions cache
$user->refreshPermissionsCache();
// Manual cache operations
$cache = app(CacheService::class);
$cache->forgetUser($userId);
$cache->forgetRole($roleId);
$cache->flush();
Community Discussions 0
Ask questions, share step solutions, or discuss software workflows with other professionals.
Moderated Community
Join the Community Discussion
Got stuck on a step or have a question about this configuration? Sign in to join the discussion and receive direct advice from instructors and peers.
Guide Checklist
4 Steps
Tutorial Progress
0%
No Discussions Yet
Have a question or found a clever tip for this guide? Start the conversation using the comment box above!