Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable auto cache control of the Symfony SessionListener #1033

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

Toflar
Copy link
Member

@Toflar Toflar commented Nov 29, 2019

Fixes #1028.

In fact, we don't need the default behaviour of Symfony because we qualify for "advanced usage" and our listener already correctly handles making responses private if needed.
I thought we need session stacking but that's not required because the SessionListener of SF correctly closes the session during kernel.finish_request which will cause our listener to correctly determine that the session was not started yet during the next kernel.response.

@leofeyer leofeyer merged commit d7facc7 into master Dec 2, 2019
@leofeyer
Copy link
Member

leofeyer commented Dec 2, 2019

Thank you @Toflar.

@leofeyer leofeyer deleted the fix-caching-sf-4-4 branch December 2, 2019 11:39
@aschempp
Copy link
Member

aschempp commented Dec 2, 2019

Should we do this for everything? Or should we only do that for Contao requests? Also, I realize that this listener is in the contao-core bundle, so this is also applied to any regular Symfony application, not sure we can assume anything about caching and cookie whitelists there?

@Toflar
Copy link
Member Author

Toflar commented Dec 2, 2019

I think it's not wrong in the core-bundle but it should probably check for isFrontendMasterRequest() or what did you mean?

leofeyer pushed a commit that referenced this pull request Dec 3, 2019
…iable (see #1034)

Description
-----------

While debugging #1033 I noticed that we cannot configure the trace level of `HttpCache`. It absolutely makes no sense to bind that to `$this->isDebug` because in our case, this is always the case when we are in `dev` mode which again disables the HttpCache completely.

So here we go, by setting `TRACE_LEVEL=full` the `Contao-Cache` header gives you a lot more insight into the fragment requests.

Commits
-------

64fe068 Allow to configure the HttpCache trace level using an environment variable
leofeyer pushed a commit to contao/manager-bundle that referenced this pull request Dec 3, 2019
…iable (see #1034)

Description
-----------

While debugging contao/contao#1033 I noticed that we cannot configure the trace level of `HttpCache`. It absolutely makes no sense to bind that to `$this->isDebug` because in our case, this is always the case when we are in `dev` mode which again disables the HttpCache completely.

So here we go, by setting `TRACE_LEVEL=full` the `Contao-Cache` header gives you a lot more insight into the fragment requests.

Commits
-------

64fe0685 Allow to configure the HttpCache trace level using an environment variable
@aschempp
Copy link
Member

aschempp commented Dec 9, 2019

I think it's not wrong in the core-bundle but it should probably check for isFrontendMasterRequest() or what did you mean?

yes thats what I meant

@Toflar
Copy link
Member Author

Toflar commented Dec 9, 2019

Add an issue then so we don't forget about it.

@leofeyer
Copy link
Member

See #1079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching completely broken with Symfony 4.4
3 participants