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

Prevent the kernel response listener for cart from continuing when the session is not actually started. #9095

Merged
merged 1 commit into from Jan 12, 2018

Conversation

Projects
None yet
3 participants
@Hailong
Contributor

Hailong commented Jan 10, 2018

Q A
Branch? 1.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets n/a
License MIT

Prevent the kernel response listener for cart from continuing when the session is not actually started. Otherwise the next cartContext->getCart() method call would open a session with no sense.

A problem caused by this issue is that the following cache-control header being sent to client anyway: (because a session is started, the Symfony session listener would set that header)

cache-control:max-age=0, must-revalidate, private

For landing pages without cart, or some shop API calls need to be cached from the CDN layer, we don't want the above cache-control header being set.

BTW, by fixing the issue and installing friendsofsymfony/http-cache-bundle I managed to enable the CDN cache for some shop API calls. Otherwise, the http-cache-bundle would work as expected.

Prevent the kernel response listener for cart from continuing when th…
…e session is not actually started. Otherwise the next cartContext->getCart() method call would open a session with no sense.

A problem caused by this issue is that the following cache-control header being sent to client anyway:

  cache-control:max-age=0, must-revalidate, private

For landing pages without cart, or some shop API calls need to be cached from the CDN layer, we don't want the above cache-control header being set.
@pamil

pamil approved these changes Jan 12, 2018

@pamil pamil merged commit 62fb104 into Sylius:1.0 Jan 12, 2018

2 checks passed

Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pamil

This comment has been minimized.

Show comment
Hide comment
@pamil

pamil Jan 12, 2018

Member

Thank you @Hailong! 🎉

Member

pamil commented Jan 12, 2018

Thank you @Hailong! 🎉

@Hailong

This comment has been minimized.

Show comment
Hide comment
@Hailong

Hailong Jan 12, 2018

Contributor

Thank you @pamil , I'm happy to contribute. You are doing a great job!

Contributor

Hailong commented Jan 12, 2018

Thank you @pamil , I'm happy to contribute. You are doing a great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment