Redis as a PHP Cache Backend
Connect PHP to Redis and cache query results and computed data.
What is Redis?
Redis is an in-memory data structure server. It is the most popular caching backend for PHP applications due to its speed, rich data types, and built-in TTL support.
Installing the PHP Redis Extension
Install either the phpredis C extension (fastest) or the pure-PHP predis library.
# Predis via Composer:
$ composer require predis/predis
# Or install phpredis extension:
$ pecl install redisAll lessons in this course
- Why Caching Matters in PHP
- Redis as a PHP Cache Backend
- Memcached for Session and Object Caching
- Cache Invalidation Patterns