Commit 52ae42d
committed
Reduce priority for "NotModified" event listener
When the @ReplaceWithNotModifiedResponse annotation is used in combination
with the @Cache annotation from SensioFrameworkExtraBundle, we need to make
sure that \Webfactory\HttpCacheBundle\NotModified\EventListener is run
*after* \Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener.
The reason for this is that the "NotModified" listener will short-circuit
the controller by replacing it with a no-op callback when a 304 response
can be sent.
This callback makes it impossible for the ControllerListener to parse
annotations, since there is no longer a controller associated to the
request. So we might get a 304 response, but that might be neither
public not have the (s-)maxage settings as configured by annotations.
So, to be independent of bundle registration order, we need to use
a lower event listener priority. The downside is that now probably
the default ParamConverter listeners will unneccessarily be executed.
Given the current priorities in Symfony's FrameworkBundle and the
SensioFrameworkExtra bundle, there is no way of getting "between" things.1 parent e8903e8 commit 52ae42d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments