-
Support for the Varnish xkey vmod for more efficient cache tagging.
-
Autoconfigure support for custom context providers.
-
Autowiring support for the services in this bundle:
- fos_http_cache.cache_manager => FOS\HttpCacheBundle\CacheManager
- fos_http_cache.http.symfony_response_tagger => FOS\HttpCacheBundle\Http\SymfonyResponseTagger
- fos_http_cache.event_listener.cache_control => FOS\HttpCacheBundle\EventListener\CacheControlListener
- fos_http_cache.proxy_client.default => FOS\HttpCache\ProxyClient\ProxyClient
The old service names are still available, but using them directly is deprecated.
- Regression in the configuration when you explicitly specified the
defaultproxy client. This started to be reported as error in 2.3.0 and now works again.
- [Symfony HttpCache] You can now configure the Symfony proxy client to
directly call the
HttpCachefor invalidation requests instead of executing real web requests. Use the new configuration optionproxy_client.symfony.use_kernel_dispatcherand follow the instructions in FOSHttpCache to adjust your kernel and bootstrap things accordingly.
- Fix
session_listenerdecoration when session is not enabled.
- Adjust user context listener to handle Symfony 4.1 breaking behaviour change.
Support for Symfony 4. (Note that only the fos_http_cache.cache_manager
service is public in Symfony 4. Use dependency injection if you need direct
access to other services.)
-
You can now use cache tags and invalidate them with the Symfony
HttpCachereverse proxy. You can tweak configuration in theproxy_client.symfonysection of the configuration. See the FOSHttpCache documentation for instructions on how to set up the cache. -
Allow to configure the purge method for the Symfony proxy client.
-
You can now also match requests with regular expressions on the query string. The new option
match.query_stringis available for cache control rules, tags and invalidation. -
ETags can now be false, strong or weak by setting
headers.etagoption to"strong"or"weak"respectively. Valuetruedue to backward compatibility will be resolved as"strong".
-
The FlashMessageListener has been broken during refactoring for 2.0 and now works again. Constructor uses an options array.
-
Tag annotations now work with SensioFrameworkExtraBundle 4. An accidental exception prevents using them with FOSHttpCacheBundle 2.0 and 2.1.
-
User context is more reliable not cache when the hash mismatches. (E.g. after login/logout.)
-
The
ContextInvalidationLogoutHandlerhas been deprecated in favor of theContextInvalidationSessionLogoutHandler. The original handler was called after the invalidation of the session, and thus did not invalidate the session it should have but a newly created one. You should remove the deprecated servicefos_http_cache.user_context.logout_handlerfrom the logout.handlers section of your firewall configuration. -
User context compatibility which was broken due to Symfony making responses private if the session is started as of Symfony 3.4+.
- Setting up custom services with the commands provided in this bundle has been
deprecated. The
$commandNameconstructor argument will be removed in 3.0.
-
Individual rules in the
cache_controlcan now again have amatch_responseoradditional_response_statusconfiguration to limit the rule to certain responses.For this, the signature of CacheControlListener::addRule had to be changed. It now expects a RuleMatcherInterface instead of the ResponseMatcherInterface. If you extended the listener or change the service configuration, this could be a BC BREAK for your application.
-
If no response matching is configured on
cache_control, the globalcacheableconfiguration is now respected to decide whether cache headers should be set. By default, this follows RFC 7234, only responses with status 200, 203, 204, 206, 300, 301, 404, 405, 410, 414 or 501 get cache headers.We decided to consider this a bugfix, but if your relied on this behaviour it will be a BC BREAK for your application.
- Updated the version of FOSHttpCache to 2.0.0. See the FOSHttpCache changelog for more information. Most importantly, we removed the hard coupling on the Guzzle HTTP client (using HTTPlug). Your composer.json now needs to specify which HTTP client to install; see the installation instructions
- Deprecated methods have been removed.
- The configuration for the proxy client has been adjusted. Proxy servers are
now configured under
httpandserversmust be a list - a comma separated string of server IPs is no longer supported.
- BC break: the
UserContextListenerconstructor signature was changed to take an array of options. - BC break: renamed the event listener classes to
XyzListener.
-
BC break: The
match_responseandadditional_cacheable_statusconfiguration parameters were removed for individual match rules. Note thatmatch_responseandadditional_response_statushave been re-added forcache_controlin 2.0.1. -
BC break: The second argument of the
RuleMatcherconstructor was changed to take aResponseMatcherInterface. -
Cacheable status codes are now configured globally (
cacheable.response.additional_statusorcacheable.response.expression).
- BC break: The TagHandler has been split. Invalidating tags happens through
CacheManager::invalidateTags (if you use annotations for tag invalidation, you
don't need to change anything). Recording tags and writing them into the
responses is now done through the SymfonyResponseTagger.
The service
fos_http_cache.handler.tag_handlerno longer exists. For tagging responses, usefos_http_cache.http.symfony_response_taggerinstead, and to invalidate tags use the servicefos_http_cache.cache_manager. - BC break: The configuration
tags.headerhas been removed. Configuring the header for tagging responses is now done attags.response_header. Configuring the header for tag invalidation requests is now done atproxy_client.varnish.tags_header.
- BC break: Dropped the proxy client services as they where not used anywhere. The
services
fos_http_cache.test.client.varnishandfos_http_cache.test.client.nginxno longer exist.
- Added an option
always_vary_on_context_hashto make it possible to disable automatically setting the vary headers for the user hash.
- Fix session_listener decoration when session is not enabled.
- User context compatibility which was broken due to Symfony making responses private if the session is started as of Symfony 3.4+.
-
Symfony HttpCache User Context: Move the AnonymousRequestMatcher to FOSHttpCache.
The recommended way to ignore cookie based sessions is to set
session_name_prefixto false rather than omit the Cookie header fromuser_identifier_headers.
- Prevent potential accidental caching on user context hash mismatch (particularly with symfony HttpCache).
- #395 : Compatibility with SensioFrameworkExtraBundle 4.
- Avoid calling deprecated method in Symfony 3.2.
- Fix configuration handling when only custom proxy client is configured.
- Do not sanity check hash on anonymous requests.
- Add a sanity check on UserContextHash to avoid invalid content being cached
(example: anonymous cache set for authenticated user). This scenario occures
when the UserContextHash is cached by Varnish via
fos_http_cache.user_context.hash_cache_ttl> 0 and the session is lost via garbage collector. The data given is the anonymous one despite having a hash for authenticated, all authenticated users will then have the anonymous version. Same problem could occurs with users having is role changed or anything else that can modify the hash.
- Fixed some status codes (such as 204 and 302) not triggering invalidation.
- Fixed configuration handling with symfony and nginx cache client. Cache tagging is now immediately reported to not work with those clients.
- Added configuration for Symfony HttpCache client and HttpCache now loads purge and refresh handlers by default.
- Configured/annotated cache tags on subrequests (in Twig:
render(controller())) are no longer ignored. Additionally, it is now possible to add tags from code before the response object has been created, by using the TagHandler, and from Twig with thefos_httpcache_tagfunction. If you defined custom services for theInvalidateTagCommand, you should now inject the TagHandler instead of the CacheManager. - deprecated
CacheManager::tagResponsein favor ofTagHandler::addTags - Added configuration option for custom proxy client (#208)
- Added support for a simple Etag header in the header configuration (#207)
-
Refactored the Symfony built-in HttpCache support to be extensible.
FOS\HttpCacheBundle\HttpCacheis deprecated in favor ofEventDispatchingHttpCache.BC break: If you overwrite cleanupForwardRequest in your cache kernel, you need to extend FOS\HttpCache\SymfonyCache\UserContextSubscriber and move that logic to the method cleanupHashLookupRequest in there.
- Allow cache headers overwrite.
- Added support for the user context lookup with Symfony built-in reverse
proxy, aka
HttpCache.
Initial release. To migrate from other Symfony2 cache bundles, see LiipCacheControlBundle or DriebitHttpCacheBundle.