-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel][HttpCache][RFC] SSI kernel proxy #6766
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
Conversation
* @param array $config An SSI configuration array | ||
* @param XmlFileLoader $loader An XmlFileLoader instance | ||
*/ | ||
private function registerSsiConfiguration (array $config, XmlFileLoader $loader) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor issue .. {
needs to be on the next line
i think this separation makes sense. HttpCache imho should become its own component especially because I believe there is still a lot of potential work people might want to put in it to improve cache invalidation etc. that being said .. i didnt look really review the code itself in much detail aside from the CS issues i noted. |
I found a little bit time 😄 The However, the
It's late here, so currently don't know, which is the better solution right now. I'll think about it later (also depending on whether this PR still can go into 2.2, or not 😉). The |
Removed
The Any suggestions? |
/** | ||
* @author Sebastian Krebs <krebs.seb@gmail.com> | ||
*/ | ||
interface IncludeProxyInterface extends HttpKernelInterface,TerminableInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this interface is useless IMO
This is flawed. It does not handle the headers of the final response properly. For instance, the max age of the final response should be the smaller age among all responses used to build it. |
@stof Maybe I don't understand you, but I thought it does ❓
It takes the lowest value of all responses (including Oh, and when anybody has suggestions how to handle the validation headers, I would like to hear them too 😄 Did I forgot other headers? |
Well, the other caching headers probably need to be handled too ( |
Bug fix: no
Feature addition: yes
Backwards compatibility break: possible
Deprecations: possible
Fixes the following tickets: ~
Todo: see below
License of the code: MIT
Documentation PR: ~
Yes this is my second pull request about SSI-implementation (third, if you count the closed pre-
HttpKernel
-refactoring PR), but I came to the conclusion, that it could be more appropiate to separateHttpCache
and the substitution of the include tags from each other, but before I put to much effort in an unwanted idea, I want to hear some opinions.The motivation/idea
HttpCache
can concentrate on its purpose. Therefore I would separate the esi-substitution too. This should make both easier to maintainAs a sideeffect
HttpCache
(when used) will cache the original content including the ssi-tag and the parsing of the tag will occur on every request. But we can get rid ofeval()
😉The first commit contains the SSI rendering strategy, which is exactly the same as in my other PR.
The second commit is the single class
SsiKernelProxy
. When ESI should be separated too I would rewrite it into aIncludeKernelProxy
-class, which consumes one or moreIncludeSubstitutionStrategy
-objects, that handles the differences.TODO
For now the proxy doesn't respect any
Surrogate-*
-header, but I probably shouldWhen from a server a
Surrogate-Capability
with the corresponding value (I guessSSI/1.0
?) is set, this proxy should passthrou the request without handling, so it act as a fallbackI would like to handle
maxage
ands-maxage
separately:In the current esi-implementation
maxage
is always set to0
, but when I get it right it is more probably, that a on this way constructed page is private, than that it is public.The current implementation already works in my demo-application.