See also the GitHub releases page.
- Raised minimal PHP version to 7.2
- Added support for PHP 8.0
- Added a neutral "Bad Request" body to user hash mismatch response to have something searchable in the code when debugging.
- Fix: Preserve inline credentials when multiplexing to the proxy servers.
- Allow to use inline credentials for the caching proxy URL in the format http://user:pass@1.2.3.4
- Raised minimal PHP version to 7.1
- Test helper classes upgraded to support PHPUnit 7/8
- There is no php-http/discovery package 2.0, drop it from composer.json
- Adapt for changes to NetworkException in HTTPlug 2.1 for PSR-18 compatibility
- Fixed issue with
PurgeTagsListener
and Symfony 5 - Fixed clearing the cache completely together with toflar psr6 store did not work
- Support Symfony 5
- Use
LegacyEventDispatcherProxy
for Symfony >= 4.3 to avoid deprecation messages. - Added Fastly ProxyClient Adapter with ClearCapable, PurgeCapable, RefreshCapable, & TagCapable. Fastly is a CDN originally based on Varnish 2.x, so with many of the same capabilities like VCL and more.
- Added request type to the CacheEvent.
- Added: ClearCapable to clear the whole cache in one efficient call. Currently supported only by the Symfony HttpCache.
- Allow installing with Httplug 2.0 / PSR-18.
- Fixed: Avoid regression of 2.5.3: If there are no messages to be dispatched, do not throw an exception if the HttpCache is not set.
- Fixed: Handle HttpCache not available in KernelDispatcher and fix return type annotations - if HttpCache is not set, it can't be returned.
- Fixed: Remove the xkey header in vcl_deliver if we are not in debug mode
- Do not cleanup the Vary header and keep the user context hash if we are in debug mode
- Fixed: Clear the ResponseTagger after we tagged a response. Usually PHP uses a new instance for every request. But for example the hash lookup when using Symfony HttpCache does two requests in the same PHP process.
- Fixed:
MaxHeaderValueLengthFormatter::getTagsHeaderName
now actually returns the value.
- Added:
MaxHeaderValueLengthFormatter
to allow splitting cache tag headers into multiple headers.
- Have cache invalidator check for presence of Psr6Store for a better guess whether the cache really is TagCapable or not.
- Added:
CleanupCacheTagsListener
to remove the cache tags header from the final response that is sent to the client. Add this listener to your cache kernel.
- Improved: The
ResponseTagger
does now remove duplicate tags.
- Fixed: Do not
preg_quote
tags when using xkey. Quoting is only used for BAN requests that expect a regular expression. This bug only affected you if you use xkey and used characters in your tags that are changed bypreg_quote
.
- The
HttpProxyClient
now accepts an instance of the newDispatcher
interface instead of the concreteHttpDispatcher
, allowing for more flexibility.
- Introduced a new
KernelDispatcher
for the Symfony proxy that calls the application kernel directly instead of executing a full HTTP request.
- The provided VCL for custom TTL no longer provides
import std;
because each import may only exist once.
- Added support for the more efficient xkey cache tag system. BAN remains the default cache tagging system, but if you can install the varnish modules in your system, it is recommended to update to xkey.
- No inline C is needed for the custom TTL header with Varnish 4 or better. use
std.duration()
instead.
- You can now also specify which headers are used for
authentication to detect anonymous requests. By default, the headers are the
previously hardcoded
Authorization
,HTTP_AUTHORIZATION
andPHP_AUTH_USER
.
- Fixed bug in Symfony tag invalidation. Do not check if host is missing in request creation.
- Fixed issue with detection if toflar psr6 store is available.
-
Updated X-Cache-Tags regex to prevent matching partial tags
Invalidating objects with a tag of 'bar' would have previously also have invalidated objects with a tag that ends in 'bar', eg. 'foobar'. Now when invalidating an object the tag name must match in full.
- Support Symfony 4.
- Upgraded phpunit to 5.7 / 6. If you use anything from the
FOS\HttpCache\Test
namespace you need to update your project to use PHPUnit 6 (or 5.7, if you are using PHP 5.6).
-
Cache tagging support for Symfony HttpCache
Added a
PurgeTagsListener
for tag based invalidation with the SymfonyHttpCache
reverse caching proxy. This requires the newly created Toflar Psr6Store built on PSR-6 cache and supporting pruning expired cache entries. -
Using Request::isMethodCacheable rather than Request::isMethodSafe to correctly handle OPTIONS and TRACE requests.
-
Support PHP 7.2
Avoid warning about
count(null)
in PHP 7.2.
- Ban requests now work even when no base URI is configured.
- Raised minimum PHP version to 5.6.
- BC break: Removed the
Interface
suffix from all interfaces. - BC break: Renamed
HashGenerator
toDefaultHashGenerator
. - Added
HashGenerator
interface.
- BC break: Replaced hard coupling on Guzzle HTTP client with HTTPlug. You now need to explicitly specify a supported HTTP adapter in composer.json; see installation instructions.
- BC break: Separated the HttpDispatcher from the proxy clients. All existing clients still use HTTP to send invalidation requests.
- Added support and documentation for setting a custom TTL specifically for the caching proxy.
- BC break: Renamed the log event listener from
LogSubscriber
toLogListener
.
- BC break: Renamed the
Ban
,Purge
,Refresh
andTag
interfaces toBanCapable
,PurgeCapable
,RefreshCapable
andTagCapable
.
- BC break: Moved tag invalidation to
CacheInvalidator
, and renamedTagHandler
toResponseTagger
. - Abstracting tags by adding new
TagCapable
for ProxyClients. - Added
strict
option toResponseTagger
that throws an exception when empty tags are added. By default, empty tags are ignored. - Added
TagHeaderFormatter
interface that is used within theResponseTagger
to provide the header name and for formatting the tags header value.
- Varnish configuration are now files that you can directly include from your .vcl and call custom functions to avoid copy-pasting VCL code.
- Added support for and changed default to Varnish version 5.
- Moved Varnish 4 and 5 configuration files from
resources/config/varnish-4/
toresources/config/varnish/
. - Changed default Varnish version to 5.
- Removed special case for anonymous users in user context behaviour. Varnish now does a hash lookup for anonymous users as well.
- The NGINX purge location is no longer passed as constructor argument but by
calling
setPurgeLocation()
.
- BC break: Renamed all event listeners to
XxListener
instead ofXxSubscriber
. - BC break: Constructors for
PurgeListener
andRefreshListener
now use an options array for customization. - BC break: Converted abstract event dispatching kernel class
EventDispatchingHttpCache
to a trait, which now provides theaddSubscriber
andaddListener
methods. In yourAppCache
, replaceAppCache extends EventDispatchingHttpInterface
with ause EventDispatchingHttpCache;
statement. - The user context by default does not use a hardcoded hash for anonymous users but does a hash lookup. You can still configure a hardcoded hash.
- BC break: Refactored the proxy client test system into traits. Removed
ProxyTestCase
; use the traitsCacheAssertions
andHttpCaller
instead. - Added HTTP method parameter to
HttpCaller::getResponse()
.
- BC break: The
ResponseTagger
no longer expects an instance ofTagCapable
as first argument. To adjust the tag header name or the way the tags are formatted, use the newheader_formatter
option with aTagHeaderFormatter
.
- [Symfony HttpCache] Added a neutral "Bad Request" body to user hash mismatch response to have something searchable in the code when debugging.
- Symfony user context: You can now also specify which headers are used for
authentication to detect anonymous requests. By default, the headers are the
previously hardcoded
Authorization
,HTTP_AUTHORIZATION
andPHP_AUTH_USER
.
- Avoid problem with http_method_override.
- Avoid warning about
count(null)
in PHP 7.2.
- The TagHandler constructor now accepts a
headerLength
argument which will cause itsinvalidateTags
function to invalidate in batches if the header length exceeds this value.
- Support for Symfony 3.
- Added symfony/http-kernel HttpCache client.
- Added SymfonyTestCase.
- Removed unneeded files from dist packages.
- Added
TagHandler->hasTags()
method.
- Added authentication support to user context subscribe.
- Fixed usage of deprecated Guzzle subtree splits.
- Fixed exposed cache tags.
- Added TagHandler.
- It is no longer possible to change the event dispatcher of the CacheInvalidator once its instantiated. If you need a custom dispatcher, set it right after creating the invalidator instance.
- Deprecated
CacheInvalidator::addSubscriber
in favor of either using the event dispatcher instance you inject or doinggetEventDispatcher()->addSubscriber($subscriber)
.
- Added support for the symfony/http-kernel component reverse proxy HttpCache.
- Fixed documentation for user context varnish configuration to also work when
client omits the
Accept
HTTP header.