Skip to content

[FrameworkBundle] Dont set pre-defined esi/ssi services #23088

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

Closed
wants to merge 2 commits into from
Closed

[FrameworkBundle] Dont set pre-defined esi/ssi services #23088

wants to merge 2 commits into from

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Jun 7, 2017

Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? not sure
Deprecations? no
Tests pass? yes/no
Fixed tickets #23080
License MIT
Doc PR symfony/symfony-docs#...

It fixes the issue, but im not sure what's expected if you dont use http cache (solely enabled ssi/esi in config). Before the services were initialized, now they are synthetic as http cache sets them, but thats optional =/

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 9, 2017

Complex topic :)
This will break if anyone is using e.g. the 'esi' service directly.
If adding the "cache" service in the xml is not required, I'd suggest removing it also, for BC concerns.
Then, what about deprecating the esi and ssi services, and passing the service around using a request parameter instead? It's a scoped service to me, that doesn't fit the container, isn't it?

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Jun 9, 2017
@ro0NL
Copy link
Contributor Author

ro0NL commented Jun 9, 2017

👍 for deprecation the esi/ssi defintions (and revert adding cache definition).

About

$this->getKernel()->getContainer()->set('cache', $this);
$this->getKernel()->getContainer()->set($this->getSurrogate()->getName(), $this->getSurrogate());

Is this needed, either setting them as request attribute or service =/ I believe @cache will equal @kernel anyway. And @<surrogate-name> equals @kernel->getSurrogate()

Not sure we need to pass anything here =/

edit:
but @esi_listener needs a patch, or indeed, depend on a request param.

@nicolas-grekas
Copy link
Member

@ro0NL right, let's try this way.

@ro0NL
Copy link
Contributor Author

ro0NL commented Jun 9, 2017

Hm.. we can have 2 SurrogateListener's, the HttpCache will only have 1 surrogate.

So we cant deprecate the service really, but we should check for a esi/ssi surrogate from the kernel first. Let me try :)

@ro0NL
Copy link
Contributor Author

ro0NL commented Jun 9, 2017

Something like this :)

@ro0NL ro0NL changed the title [FrameworkBundle] Define synthetic http cache services [FrameworkBundle] Dont set pre-defined esi/ssi services Jun 9, 2017
@fabpot
Copy link
Member

fabpot commented Jun 14, 2017

Thank you @ro0NL.

fabpot added a commit that referenced this pull request Jun 14, 2017
…o0NL)

This PR was squashed before being merged into the 3.3 branch (closes #23088).

Discussion
----------

[FrameworkBundle] Dont set pre-defined esi/ssi services

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | not sure
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #23080
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

It fixes the issue, but im not sure what's expected if you dont use http cache (solely enabled ssi/esi in config). Before the services were initialized, now they are synthetic as http cache sets them, but thats optional =/

Commits
-------

8c26aab [FrameworkBundle] Dont set pre-defined esi/ssi services
@fabpot fabpot closed this Jun 14, 2017
@fabpot fabpot mentioned this pull request Jul 4, 2017
@ro0NL ro0NL deleted the issue/23080 branch July 6, 2017 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants