Skip to content

Releases: WyriHaximus/reactphp-http-middleware-response-cache

3.0.0

03 Sep 11:41
3.0.0
Compare
Choose a tag to compare
  • Bumped react/cache to 0.5
  • Bumped minimum PHP version to 7.2

2.0.0

10 Apr 19:51
2.0.0
b72629d
Compare
Choose a tag to compare

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

04 Apr 06:29
1.2.1
Compare
Choose a tag to compare
  • Solved a clock type checking issue

1.2.0

03 Apr 22:23
1.2.0
3bb033b
Compare
Choose a tag to compare
  • Bumped minimum PHP version to 7.1
  • Ship Age header with response when serving a response from cache

1.1.0

23 Feb 18:56
1.1.0
Compare
Choose a tag to compare
  • Added support for wildcards to cache whole lists of URL's without having to configure all of them

1.0.0

23 Feb 12:55
1.0.0
Compare
Choose a tag to compare
  • Initial release