Redis Cache
Last updated
Was this helpful?
Was this helpful?
<?php
$cache = new RedisCache();
$phpFast = 'Welcome to PHPFast Framework'
$cache->set('php_fast', $phpFast, 600); // Cache for 10 minutesfunction get($key)<?php
$phpFast = $cache->get('php_fast');
if ($phpFast !== null) {
echo "Data loaded from cache.";
} else {
echo "Data not found in cache.";
}function delete($key)$cache->delete('php_fast');function has($key)<?php
if ($cache->has('php_fast')) {
echo "Cache exists for php_fast.";
} else {
echo "No cache for php_fast.";
}function clear()$cache->clear();