Projects 2026
Laravel Azure Table Cache
A Laravel cache driver backed by Azure Storage Tables — a drop-in alternative to Redis for applications already on Azure that would rather not run another service.
Running Redis for a cache you hit a few hundred times a minute is a service to provision, monitor and pay for. If the application is already on Azure, Storage Tables are sitting there with no additional infrastructure attached.
How it stores things
Each entry is a table row: partition key, row key, the serialised and compressed value, and an expiry timestamp. Expiry is enforced on read, so a stale row never returns a value even if nothing has swept it yet. Two Artisan commands handle the housekeeping:
php artisan azure-table-cache:create-table # idempotent
php artisan azure-table-cache:purge-expired
Configuration
The store goes in config/cache.php with driver set to azure-table, plus account_name, account_key, an optional endpoint, and the table, partition_key and prefix keys. Setting CACHE_STORE=azure-table makes it the default.
The constraint to design around
Cache keys are written straight into the Azure Table RowKey with no encoding. That means /, \, #, ? and the control characters 0x00–0x1F and 0x7F are forbidden, and the key cannot exceed 1024 bytes.
This is a deliberate choice rather than an oversight: encoding keys would make them unreadable in Storage Explorer, which is exactly where you go when you are trying to work out why a cache entry is not what you expected. The tradeoff is that any key built from user input needs hashing first — which is good practice regardless.
Numbers
| Measure | Value |
|---|---|
| Composer package | marmanik/laravel-azure-table-cache |
| Requires | PHP 8.2+ · Laravel 11 or 12 |
| Cache key limit | 1024 bytes |
| Licence | MIT |