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.

A Administrator Oct 19, 2026 4 Steps 2,630 views
Discussion (0)
Step 1 of 4

Overview

OMNI Access includes basic caching to improve performance.

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',
]
php
// config/omni-access.php
'cache' => [
    'enabled' => true,
    'expiration_time' => 60 * 24, // 24 hours in minutes
    'key_prefix' => 'omni_access',
]
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
bash
# 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
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)

php
// 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();
Previous Step

Congratulations! You Completed This Guide

You've walked through all 4 steps for OMNI Access v1.3.0. Keep practicing and exploring more hands-on tutorials.

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.

No Discussions Yet

Have a question or found a clever tip for this guide? Start the conversation using the comment box above!

Promotional Ads Available Space
Place Your advertising ads Here

Promote your brand, product, or service directly to our active readers and community.

Contact Us