为什么 storage 里面要加入缓存 cache
今天看文档, storage里面可以加入缓存cache
An absolute must for performance is to use a cached adapter. You will need an additional package for this:
- CachedAdapter: league/flysystem-cached-adapter ~1.0
's3' => [
'driver' => 's3',
// Other Disk Options...
'cache' => [
'store' => 'memcached',
'expire' => 600,
'prefix' => 'cache-prefix',
],
],
不明白为什么文件系统要加入缓存.
如果用的是云存储, 应该读取是直接从云端直接传给用户, 也不用经过服务器.
如果是存储到本地, 本来已经是文件了, 难道要写入内存来进行缓存吗? 那这样多读取几张图片内存就不够了啊.
查到了一篇关于
league/flysystem-cached-adapter
的介绍, 大概意思就是用来缓存meta-data
来加速io读取效率https://flysystem.thephpleague.com/v1/docs...