Skip to content

Magento 2 – Logout not possible, because controller request is cached on client

I am unable to logout on one of my projects.

An image showing that the Cache-Control Header is set to max-age=86400

The customer/account/logout/ controller request, is getting cached.

The image showing that the Cache-Control Header is set to max-age=86400, public, s-maxage=86400 which leads to the request being cached on disk and not called anymore. If I put a xdebug breakpoint inside the controller, then it is not triggered.

I am using redis and the built in magento 2 cache.

I know how I can fix this with a plugin and I already have such a solution, but since I don’t have this problem on another machine with the same project and also using the same caching procedure, it shows that it must be a configuration problem.

I tried it on another machine where redis is not setup and configured to be used, and I have the same problem. So I can exclude that redis is the problem.