friendsofsymfony/http-cache-bundle
Set path based HTTP cache headers and send invalidation requests to your HTTP cache
3.4.1
14M downloads/mo
#1636 most downloaded on Packagist
FriendsOfSymfony/FOSHttpCacheBundle
What this package is like to depend on
Last release 2 months ago
08 Jun 2026
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 64 of 73 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
81 releases · first in 2014
3 releases in the last 12 months
see the full history below
Release timeline
81 releases · Jun 2014 to Jun 2026Releases
latest 60 of 81-
3.4.108 Jun 2026Release notes
Open source →- Fixed configuration validation to allow
generate_url_typealso whenproxy_client.varnish.http.base_urlis configured, not only whenproxy_client.[client].base_urlis configured.
Release notes
Open source →- Fixed configuration validation to allow
generate_url_typealso whenproxy_client.varnish.http.base_urlis configured, not only whenproxy_client.[client].base_urlis configured.
- Fixed configuration validation to allow
-
3.4.005 Mar 2026Release notes
Open source →- Configuration for
generate_url_typeis now on top level instead of on thecache_manager, and applies to the InvalidationListener too.
Configuringcache_manager.generate_url_typeis deprecated and will be removed in version 4.
Release notes
Open source →- Configuration for
generate_url_typeis now on top level instead of on thecache_manager, and applies to the InvalidationListener too. Configuringcache_manager.generate_url_typeis deprecated and will be removed in version 4.
- Configuration for
-
3.3.013 Jan 2026Release notes
Open source →- Compatibility with Symfony 8 (changed configuration from XML to PHP).
- Tested with PHP 8.5.
Release notes
Open source →- Compatibility with Symfony 8 (changed configuration from XML to PHP).
- Tested with php 8.5.
-
3.2.017 Jun 2025Release notes
Open source →- If a custom proxy client is configured on the cache manager, the
ProxyClientclass is an alias to that client, to support autowiring. - Attribute configuration now also works on single action controllers with the
__invokemethod. - New configuration option
proxy_client.*.http.request_factoryandstream_factoryto support custom PSR-17 HTTP request and stream factories for proxy clients.
Release notes
Open source →- If a custom proxy client is configured on the cache manager, the
ProxyClientclass is an alias to that client, to support autowiring. - Attribute configuration now also works on single action controllers with the
__invokemethod. - New configuration option
proxy_client.*.http.request_factoryandstream_factoryto support custom PSR-17 HTTP request and stream factories for proxy clients.
- If a custom proxy client is configured on the cache manager, the
-
3.1.212 May 2025Release notes
Open source →- Fixed
match_responseconfiguration to work with Symfony 6+. #644 - Fixed overwriting
expression_languagefor the response matcher, due to a name mismatch the configuration was ignored. #644
- Fixed
-
3.1.109 Jan 2025 -
3.1.008 Jan 2025Release notes
Open source →- New Feature: allow configuring the TTL header name for the special
reverse_proxy_ttlconfig value. #638
Release notes
Open source →- Added:
cache_control.ttl_headerto configure the TTL header name for thereverse_proxy_ttlcache control rule configuration. #638
- New Feature: allow configuring the TTL header name for the special
-
3.0.206 Nov 2024Release notes
Open source →- Fixed extension to depend on the DependencyInjection component rather than the HttpKernel.
Release notes
Open source →- Fixed extension to depend on the DependencyInjection component rather than the HttpKernel.
-
3.0.107 May 2024Release notes
Open source →- Fixed regression in AttributesListener: Ignore other attributes on controller methods.
Release notes
Open source →- Fixed regression in AttributesListener: Ignore other attributes on controller methods.
-
3.0.004 May 2024Release notes
Open source →- Minimum PHP version is now 8.1
- Support Symfony 6.4 and 7
- Drop obsolete annotations support, use attributes
Remove all configuration you have at
fos_http_cache.tags.annotations - Make
fastlyandcloudflareclients lazy loaded to support Symfony secrets that are only available at runtime, but not yet when the container is built. - Removed deprecated
FOS\HttpCacheBundle\UserContext\AnonymousRequestMatcher, use the class from theFOSHttpCachecomponent instead:FOS\HttpCache\UserContext\AnonymousRequestMatcher. - Removed obsolete
ContextInvalidationLogoutHandler, useContextInvalidationSessionLogoutHandlerinstead. - Fixed service loading to not fail when Twig is not available.
2.x
-
2.18.017 Jun 2025Release notes
Open source →- New configuration option
proxy_client.*.http.request_factoryto support custom HTTP request factories for proxy clients.
Release notes
Open source →- New configuration option
proxy_client.*.http.request_factoryto support custom HTTP request factories for proxy clients.
- New configuration option
-
2.17.104 May 2024 -
2.17.010 Oct 2023 -
2.16.203 Aug 2023Release notes
Open source →- Catch
SessionNotFoundExceptionin FlashMessageListener, as Symfony 6 moved from returningnullto throwing an exception. - Add
: voidto commands to avoid warning from Symfony 6.3, prepare for Symfony 7 support.
- Catch
-
2.16.123 May 2023Release notes
Open source →- Add
: voidreturn to compiler passes to avoid warning from Symfony 6.3, and prepare for Symfony 7 support.
- Add
-
2.16.004 May 2023Release notes
Open source →- Added support for AWS cloudfront, using the
jean-beru/fos-http-cache-cloudfrontpackage.
- Added support for AWS cloudfront, using the
-
2.15.021 Feb 2023 -
2.14.001 Dec 2022Release notes
Open source →- Fix handling of custom glue for response tags. If you use custom glue with the Symfony HttpCache,
you can now configure a customized tag header parser on the
PurgeTagsListener.
- Fix handling of custom glue for response tags. If you use custom glue with the Symfony HttpCache,
you can now configure a customized tag header parser on the
-
2.13.001 Sep 2022 -
2.12.111 May 2022 -
2.12.010 May 2022Release notes
Open source →- Support Symfony 6
- Drop support for Symfony 3 and 4.3 (keep using
2.11.*for legacy projects).
-
2.11.208 Nov 2021 -
2.11.120 Sep 2021Release notes
Open source →Fixed
- Fixed readthedocs.io configuration. This needs a release to show up as the latest doc (which had no longer been updated in quite a while because of build errors)
-
2.11.015 Sep 2021Release notes
Open source →Added
- New configuration option
servers_from_jsonenvto support a variable amount of proxy servers defined via an environment variable.
- New configuration option
-
2.10.325 May 2021Release notes
Open source →Fixed
- Do not error in
InvalidationListenernorTagListenerwhensymfony/expression-languageis missing but no expression is used. - Properly report missing
symfony/expression-languagewhen an expression is used in response configuration.
- Do not error in
-
2.10.226 Jan 2021Release notes
Open source →Fixed
- The fix about overwriting flash messages on multiple redirects introduced in version 2.9.1 created the risk of losing flash messages when redirecting to a path that is outside the firewall or destroys the session. This version hopefully fixes both cases. Existing flash messages in a request cookie are merged with new flash messages from the session.
-
2.10.122 Dec 2020Release notes
Open source →Fixed
- Fix typehint in PHP 8 attributes handling to use ControllerResolverInterface
-
2.10.021 Dec 2020Release notes
Open source →Changed
- Adjusted to work with PHP 8
- Dropped support for PHP 7.2
- Added support for PHP 8 Attributes
-
2.9.226 Jan 2021Release notes
Open source →Fixed
- The fix about overwriting flash messages on multiple redirects introduced in version 2.9.1 created the risk of losing flash messages when redirecting to a path that is outside the firewall or destroys the session. This version hopefully fixes both cases. Existing flash messages in a request cookie are merged with new flash messages from the session.
-
2.9.127 Nov 2020Release notes
Open source →Fixed
- Flash messages won't be lost even when redirecting multiple times.
-
2.9.020 Aug 2020Release notes
Open source →Added
- New Feature: Command
fos:httpcache:clearto clear the whole http cache.
- New Feature: Command
-
2.8.028 Nov 2019Release notes
Open source →Fixed
- Adjusted to work with Twig 3
- Adjusted to work with Symfony 5
- Allow Httplug 2
-
2.7.216 Oct 2019 -
2.7.108 Oct 2019Release notes
Open source →Fixed
- Avoid deprecation warning about
TokenInterface::getRoles. - Improve exception message if a tag capable client is not found.
- Avoid deprecation warning about
-
2.7.012 Jun 2019Release notes
Open source →Changed
- Allow to use environment variables to configure the caching proxy.
Fixed
- Invalidate the user context cache also when impersonating a user and when stopping to impersonate.
-
2.6.114 Dec 2018Release notes
Open source →Fixed
- Do not leak the
Symfony-Session-NoAutoCacheControlheader when the Symfony session system is not enabled.
- Do not leak the
-
2.6.023 Oct 2018Release notes
Open source →Changed
- User context lookup now tags the hash lookup response. The logout listener can now invalidate that tag instead of doing a BAN request. The previous varnish BAN request has been incorrect and banned all cache entries on Varnish. The logout handler is now also activated by default for the Symfony HttpCache in addition to Varnish and Noop.
Fixed
- Cache Tagging: It is now possible to use cache tagging without installing the
SensioFrameworkExtraBundle. There is a new configuration optiontags.annotations.enabledthat can be set tofalse.
-
2.5.104 Oct 2018Release notes
Open source →Fixed
- Cache Tagging: Clear the SymfonyResponseTagger 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.
-
2.5.001 Oct 2018Release notes
Open source →Added
- New Feature: Support for the max_header_value_length option to split huge tag lists into multiple headers. #483
Fixed
- Cache control on Symfony 4.1 now also works when the Vary header for user_context_hash is already present on the response. #485
-
2.4.109 Aug 2018Release notes
Open source →- Adjust session_listener to work with Symfony 3.4.12 (https://github.com/symfony/symfony/pull/27467).
-
2.4.018 Jun 2018Release notes
Open source →Added
-
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.
-
-
2.3.124 Apr 2018Release notes
Open source →Fixed
- 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.
- Regression in the configuration when you explicitly specified the
-
2.3.024 Apr 2018Release notes
Open source →Added
- [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.
- [Symfony HttpCache] You can now configure the Symfony proxy client to
directly call the
-
2.2.220 Apr 2018 -
2.2.116 Apr 2018Release notes
Open source →Fixed
- Adjust user context listener to handle Symfony 4.1 breaking behaviour change.
-
2.2.023 Mar 2018Release notes
Open source →Support for Symfony 4. (Note that only the
fos_http_cache.cache_managerservice is public in Symfony 4. Use dependency injection if you need direct access to other services.)Added
-
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".
Fixed
-
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+.
Deprecated
- Setting up custom services with the commands provided in this bundle has been
deprecated. The
$commandNameconstructor argument will be removed in 3.0.
-
-
2.2.0-alpha109 Nov 2017 pre-releaseNothing published for this version
-
2.1.212 Jan 2018Nothing published for this version
-
2.1.117 Jul 2017Nothing published for this version
-
2.1.023 Jun 2017Release notes
Open source →Added
-
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.
Fixed
-
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.
-
-
2.0.010 Jun 2017Release notes
Open source →General
- 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.
Proxy client
- 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.
Event listeners
- BC break: the
UserContextListenerconstructor signature was changed to take an array of options. - BC break: renamed the event listener classes to
XyzListener.
Rule matcher
-
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).
Tags
- 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.
Tests
- 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.
User context
- Added an option
always_vary_on_context_hashto make it possible to disable automatically setting the vary headers for the user hash.
-
2.0.0-beta230 May 2017 pre-releaseNothing published for this version
-
2.0.0-beta106 Mar 2017 pre-releaseNothing published for this version
-
2.0.0-alpha106 Mar 2017 pre-releaseNothing published for this version
-
1.3.1629 Jun 2018Release notes
Open source →- Adjust session_listener to work with Symfony 3.4.12 (https://github.com/symfony/symfony/pull/27467).
-
1.3.1524 Apr 2018 -
1.3.1414 Apr 2018Release notes
Open source →- User context compatibility which was broken due to Symfony making responses private if the session is started as of Symfony 3.4+.
-
1.3.1323 Mar 2018Release notes
Open source →-
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.
-
-
1.3.1209 Nov 2017Release notes
Open source →- Prevent potential accidental caching on user context hash mismatch (particularly with symfony HttpCache).
-
1.3.1106 Nov 2017