juicyfx / vercel-examples

📦 Example projects using Vercel platform. Using Node.js, PHP and others.
https://f3l1x.io
MIT License
323 stars 150 forks source link

How to use Cache::set('key', 'test'); with CACHE_DRIVER=file? #75

Closed guoxiangke closed 2 years ago

guoxiangke commented 2 years ago

How to use Cache::set('key', 'test'); with CACHE_DRIVER=file? I change to /tmp/ , no errors, but the cache function seems not work. each trigger always fetch from DB.

        'file' => [
            'driver' => 'file',
            'path' => storage_path('framework/cache/data'),
        ],

==>

        'file' => [
            'driver' => 'file',
            'path' => '/tmp/framework/cache/data',
        ],

thanks.

f3l1x commented 2 years ago

Hey. I don't know what is Cache::set. Generally, only /tmp folder is writable. You can test it with pure file_get_contents/file_put_contents.