cache组件为添加cache到应用中提供了一个严格的psr-6实现.低开销以及即将为最流行的后台缓存使用适配器.
key concepts(概念)
Before starting to use the cache component, it's important that you learn the meaning of
some key concepts:
item
一个信息存储的独立单元,作为一个key/value对,key是唯一定义的,value是key的内容
pool
缓存的一个逻辑仓库.所有的cache操作,(保存,查看等)都是通过pool展示.应用可以定义足够多的你需要的
pool.
adapter
它实现了真正的cache机制,用于在文件系统,数据库等等中存储信息.这个component为常用的cache后台提供了准备
使用的adapter.
Basic Usage
该组建严格实现psr-6,意味着它的api一同样的标准定义.before starting to cache information, create the
cache pool using any of the built-in adapters. for example, to create a filesystem-based cache, instantiate(实例化) FilesystemAdapter:
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
$cache = new Files
key concepts(概念)
Before starting to use the cache component, it's important that you learn the meaning of
some key concepts:
item
一个信息存储的独立单元,作为一个key/value对,key是唯一定义的,value是key的内容
pool
缓存的一个逻辑仓库.所有的cache操作,(保存,查看等)都是通过pool展示.应用可以定义足够多的你需要的
pool.
adapter
它实现了真正的cache机制,用于在文件系统,数据库等等中存储信息.这个component为常用的cache后台提供了准备
使用的adapter.
Basic Usage
该组建严格实现psr-6,意味着它的api一同样的标准定义.before starting to cache information, create the
cache pool using any of the built-in adapters. for example, to create a filesystem-based cache, instantiate(实例化) FilesystemAdapter:
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
$cache = new Files