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

Add debugging information to the MakeResponsePrivateListener #1982

Merged
merged 2 commits into from Jul 27, 2020

Conversation

Toflar
Copy link
Member

@Toflar Toflar commented Jul 24, 2020

Fixes missing debug information on the MakeResponsePrivateListener which bascially leaves you in the dark about why your response was turned into a private response. We should fix that, as people will configure caching in 4.9 for years to come.

@Toflar Toflar added the bug label Jul 24, 2020
@Toflar Toflar added this to the 4.9 milestone Jul 24, 2020
@Toflar Toflar self-assigned this Jul 24, 2020
@Toflar Toflar requested a review from a team July 24, 2020 08:26
leofeyer
leofeyer previously approved these changes Jul 24, 2020

return;
}

// 2) The session was started
if ($request->hasSession() && $request->getSession()->isStarted()) {
$response->setPrivate();
$this->makePrivate($response, 'session-cookie');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use session_name() here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any value in this. The name is irrelevant.

Co-authored-by: Andreas Schempp <andreas.schempp@terminal42.ch>
@leofeyer leofeyer merged commit 1369d12 into contao:4.9 Jul 27, 2020
@leofeyer
Copy link
Member

Thank you @Toflar.

@leofeyer leofeyer changed the title Added debugging information to the MakeResponsePrivateListener Add debugging information to the MakeResponsePrivateListener Aug 10, 2020
leofeyer pushed a commit that referenced this pull request Aug 12, 2020
Description
-----------

This adds support for contao/manager-plugin#29 in manager-plugin 2.9.

According to @Toflar this should not be a problem if manager-plugin < 2.9 is installed. The interface name is just a symbol that does not exist, as long as no plugin implement it. If a plugin **does** implement it, it should require the plugin ^2.9.

Thanks to the new interface, it will be possible to add cache subscribers to do special handling that should apply to the http cache (as well). In my case, I need to implement geo localization for visitors and dynamically add _sort-of_ preflight header with the country, so responses can `Vary` on it.

I would love to have this in the LTS release, similar to #1982 this should not cause any conflicts with existing code or Contao functionality as it is totally separate.

Commits
-------

04e4489 Add support for HTTP cache subscribers
leofeyer pushed a commit to contao/manager-bundle that referenced this pull request Aug 12, 2020
Description
-----------

This adds support for contao/manager-plugin#29 in manager-plugin 2.9.

According to @Toflar this should not be a problem if manager-plugin < 2.9 is installed. The interface name is just a symbol that does not exist, as long as no plugin implement it. If a plugin **does** implement it, it should require the plugin ^2.9.

Thanks to the new interface, it will be possible to add cache subscribers to do special handling that should apply to the http cache (as well). In my case, I need to implement geo localization for visitors and dynamically add _sort-of_ preflight header with the country, so responses can `Vary` on it.

I would love to have this in the LTS release, similar to contao/contao#1982 this should not cause any conflicts with existing code or Contao functionality as it is totally separate.

Commits
-------

04e4489a Add support for HTTP cache subscribers
@Toflar Toflar deleted the fix/private-response-debug-info branch April 19, 2021 14:04
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.

None yet

4 participants