php-http/cache-plugin
PSR-6 Cache plugin for HTTPlug
2.1.0
27M downloads/mo
#964 most downloaded on Packagist
php-http/cache-plugin
What this package is like to depend on
Last release 3 months ago
12 May 2026
Ships fairly regularly
a new release about every 7 months
Nearly every release is documented
notes for 20 of 20 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
20 releases · first in 2016
2 releases in the last 12 months
see the full history below
Release timeline
20 releases · May 2016 to May 2026
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
Releases
latest 20-
2.1.012 May 2026Release notes
Open source →- Added
EtagCachePluginto cache only ETag-backed responses and always revalidate them before serving cached bodies.
Release notes
Open source →Added
- Added
EtagCachePluginto cache only ETag-backed responses and always revalidate them before serving cached bodies.
- Added
-
2.0.201 Dec 2025 -
2.0.102 Oct 2024 -
2.0.019 Feb 2024Release notes
Open source →Changed
- Drop support of deprecated PHP-HTTP
StreamFactory, only PSR-17StreamFactoryInterfaceis now supported.
Release notes
Open source →Changed
- Drop support of deprecated PHP-HTTP
StreamFactory, only PSR-17StreamFactoryInterfaceis now supported.
Version 1
- Drop support of deprecated PHP-HTTP
-
1.8.121 Nov 2023 -
1.8.028 Apr 2023Release notes
Open source →- Avoid PHP warning about serializing resources when serializing the response by detaching the stream.
Release notes
Open source →- Avoid PHP warning about serializing resources when serializing the response by detaching the stream.
-
1.7.628 Apr 2023Release notes
Open source →- Test with PHP 8.1 and 8.2
- Made phpspec tests compatible with PSR-7 2.0 strict typing
- Detect
nulland use 0 explicitly to calculate expiration
Release notes
Open source →- Test with PHP 8.1 and 8.2
- Made phpspec tests compatible with PSR-7 2.0 strict typing
- Detect
nulland use 0 explicitly to calculate expiration
-
1.7.518 Jan 2022Release notes
Open source →- Allow installation with psr/cache 3.0 (1.0 and 2.0 are still allowed too)
Release notes
Open source →- Allow installation with psr/cache 3.0 (1.0 and 2.0 are still allowed too)
-
1.7.430 Nov 2021 -
1.7.303 Nov 2021Release notes
Open source →Changed
- Be more defensive about cache hits. A cache entry can technically contain
null.
Release notes
Open source →Changed
- Be more defensive about cache hits. A cache entry can technically contain
null.
- Be more defensive about cache hits. A cache entry can technically contain
-
1.7.214 Apr 2021 -
1.7.113 Jul 2020 -
1.7.026 Dec 2019Release notes
Open source →Added
- Support for Symfony 5.
- Support for PSR-17
StreamFactoryInterface. - Added
blacklisted_pathsoption, which takes an array ofstrings(regular expressions) and allows to define paths, that shall not be cached in any case.
-
1.6.023 Jan 2019Release notes
Open source →Added
- Support for HTTPlug 2 / PSR-18
- Added
cache_listenersoption, which takes an array ofCacheListeners, who get notified and can optionally act on a Response based on a cache hit or miss event. An implementation,AddHeaderCacheListener, is provided which will add anX-Cacheheader to the response with this information.
-
v1.5.029 Nov 2017Release notes
Open source →Added
- Support for Symfony 4
Changed
- Removed check if etag is a string. Etag can never be a string, it is always an array.
-
v1.4.005 Apr 2017Release notes
Open source →Added
CacheKeyGeneratorinterface that allow you to configure how the PSR-6 cache key is created. There are two implementations of this interface:SimpleGenerator(default) andHeaderCacheKeyGenerator.
Fixed
- Issue where deprecation warning always was triggered. Not it is just triggered if
respect_cache_headersis used.
-
v1.3.028 Mar 2017Release notes
Open source →Added
- New
methodsoption which allows to configure the request methods which can be cached. - New
respect_response_cache_directivesoption to define specific cache directives to respect when handling responses. - Introduced
CachePlugin::clientCacheandCachePlugin::serverCachefactory methods to easily setup the plugin with the correct config settigns for each usecase.
Changed
- The
no-cachedirective is now respected by the plugin and will not cache the response. If you need the previous behaviour, configurerespect_response_cache_directives. - We always rewind the stream after loading response from cache.
Deprecated
- The
respect_cache_headersoption is deprecated and will be removed in 2.0. This option is replaced by the newrespect_response_cache_directivesoption. If you had setrespect_cache_headerstofalse, set the directives to[]to ignore all directives.
- New
-
v1.2.016 Aug 2016Release notes
Open source →Changed
- The default value for
default_ttlis changed fromnullto0.
Fixed
- Issue when you use
respect_cache_headers=>falsein combination withdefault_ttl=>null. - We allow
cache_lifetimeto be set tonull.
- The default value for
-
v1.1.004 Aug 2016Release notes
Open source →Added
- Support for cache validation with ETag and Last-Modified headers. (Enabled automatically when the server sends the relevant headers.)
hash_algoconfig option used for cache key generation (defaults to sha1).
Changed
- Default hash algo used for cache generation (from md5 to sha1).
Fixed
- Cast max age header to integer in order to get valid expiration value.
-
v1.0.004 May 2016