【文件属性】:
文件名称:http-client-cache:Amp的HTTP客户端的异步HTTP缓存
文件大小:22KB
文件格式:ZIP
更新时间:2021-01-28 16:01:59
php async http-client rfc-7234 amphp
http-client-cache
该包以基于的ApplicationInterceptor形式提供HTTP缓存。
特征
专用缓存( SingleUserCache )
自动vary标题支持
缓存推送响应
计划功能
共享缓存
有条件的要求
安装
该软件包可以作为依赖项安装。
composer require amphp/http-client-cache
用法
当前,仅提供SingleUserCache 。 因此,将单个实例用于多个用户是不安全的,例如,不同的访问令牌。
use Amp \ Cache \ FileCache ;
use Amp \ Http \ Client \ HttpClientBuilder ;
use Amp \ Http \ Client \ Cache \ SingleUserCache ;
use Amp \ Sync \ LocalKeyedMutex ;
$ cache = new FileCache (__DIR__, new LocalKeyedMutex );
$ client = ( new HttpClientBuilder )
【文件预览】:
http-client-cache-master
----src()
--------Internal()
--------SingleUserCache.php(22KB)
--------RequestCacheControl.php(966B)
--------functions.php(3KB)
--------ResponseCacheControl.php(1KB)
----phpunit.xml.dist(691B)
----.php_cs.dist(268B)
----examples()
--------push.php(2KB)
--------github-api-file.php(2KB)
--------github-api.php(2KB)
----.travis.yml(1KB)
----LICENSE(1KB)
----test()
--------CalculateFreshnessLifetimeTest.php(2KB)
--------NowTest.php(220B)
--------ParseDeltaSecondsTest.php(650B)
--------SingleUserCacheTest.php(5KB)
--------ParseExpiresHeaderTest.php(518B)
--------ParseCacheControlHeaderTest.php(1KB)
--------ParseDateHeaderTest.php(394B)
--------CachedResponseExternalizationTest.php(1KB)
----README.md(2KB)
----composer-require-check.json(555B)
----.editorconfig(130B)
----.gitignore(113B)
----composer.json(1KB)