jord-jd/do-file-cache
Laravel file cache driver that stores cache entries as PHP “.do” files. Simple, fast, git-friendly caching for local/dev use, with easy setup and predictable files you can inspect, commit, or clear without a database.
Illuminate\Cache) supports multiple drivers, but this package could serve as a custom driver or fallback mechanism for file-based storage. It could also complement Laravel’s existing caching (e.g., for non-critical, low-frequency data).composer require jord-jd/do-file-cache).config/cache.php:
'drivers' => [
'file_custom' => [
'driver' => 'jord-jd\DoFileCache\FileCache',
'path' => storage_path('framework/cache'),
],
],
Cache facade.file driver.| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| File system corruption | Low | Medium | Use storage_path() for reliable paths; implement backup/cleanup mechanisms. |
| Race conditions | Medium | High (multi-server) | Document single-server-only use; avoid in clustered environments. |
| Serialization issues | Medium | Medium | Test with Laravel’s common data types (e.g., Carbon, Collection). |
| Performance bottlenecks | High | High (I/O-bound) | Benchmark against Laravel’s default file driver; cache only non-critical data. |
| Package abandonment | Low | Low | Fork or monitor for updates; consider internal maintenance if critical. |
file driver or external services (Redis, APCu)?storage/framework/cache).file driver using benchmarks (e.g., laravel-debugbar).Cache::extend('file_custom', function ($app) {
return new \jord-jd\DoFileCache\FileCache(storage_path('framework/cache_custom'));
});
'default' => env('CACHE_DRIVER', 'file_custom'),
database or array driver if file cache fails:
'stores' => [
'file_custom' => [
'driver' => 'file_custom',
'failover' => 'database',
],
],
Cache::tags().Cache::fire()) that Laravel can listen to.Carbon, Collection, Model).serialize() vs. json_encode()).chmod -R 775 storage/framework/cache)./var/www/storage vs. storage_path()).file driver.config/cache.php.// app/Console/Commands/ClearFileCache.php
Cache::forget('*'); // If supported, or manual file deletion.
storage/framework/cache).chmod in deployment scripts).opcache for PHP, SSD storage).How can I help you explore Laravel packages today?