Releases: WyriHaximus/reactphp-http-middleware-response-cache
Releases · WyriHaximus/reactphp-http-middleware-response-cache
3.0.0
2.0.0
- Reworked the inner workings of the middleware and extracted all the decision logic into
CacheConfiguration
. This has the advantage that with packages likewyrihaximus/react-http-middleware-response-cache-session-cache-configuration
you can serve cached responses to clients without sessions and serve personalized pages to clients with sessions.
Old usage:
$server = new Server([
/** Other middleware */
new ResponseCacheMiddleware(
[
'/',
'/robots.txt',
'/favicon.ico',
'/cache/***', // Anything that starts with /cache/ in the path will be cached
'/api/???', // Anything that starts with /cache/ in the path will be cached (query is included in the cache key)
],
[ // Optional, array with headers to include in the cache
'Content-Type',
],
new ArrayCache() // Optional, will default to ArrayCache but any CacheInterface cache will do: https://github.com/reactphp/react/wiki/Users#cache-implementations
),
/** Other middleware */
]);
New usage:
$server = new Server([
/** Other middleware */
new ResponseCacheMiddleware(
new CacheConfiguration(
[
'/',
'/robots.txt',
'/favicon.ico',
'/cache/***', // Anything that starts with /cache/ in the path will be cached
'/api/???', // Anything that starts with /cache/ in the path will be cached (query is included in the cache key)
],
[ // Optional, array with headers to include in the cache
'Content-Type',
]
),
new ArrayCache() // Optional, will default to ArrayCache but any CacheInterface cache will work.
),
/** Other middleware */
]);
1.2.1
- Solved a clock type checking issue
1.2.0
- Bumped minimum
PHP
version to 7.1 - Ship
Age
header with response when serving a response from cache
1.1.0
- Added support for wildcards to cache whole lists of URL's without having to configure all of them
1.0.0
- Initial release