Problem/Motivation
Blocks #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!).
The content translation overview inherits the admin route status from the edit route it is extending. That means some of those are considered non-admin routes and are being cached by smartcache.
The missing cache tags for the entity and context for the access check are resulting in a lot of fails with smartcache.
Proposed resolution
Add it. We could also always disable smartcache, but it's actually not that stupid to support it.
Remaining tasks
Add some asserts for cache contexts and tags to the failing tests. See the test fails in #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!) and compare with other related child issues.
User interface changes
None.
API changes
None.
Beta phase evaluation
| Issue category | Bug because missing cacheability is a bug. |
|---|---|
| Issue priority | Major because it blocks another major (Smartcache) and getting cacheability right is important. |
| Prioritized changes | The main goal of this issue is performance. |
| Disruption | Not disruptive for core / contrib. |
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | content-translation-overview-cacheability-2500013-24-interdiff.txt | 1.84 KB | berdir |
| #24 | content-translation-overview-cacheability-2500013-24.patch | 5.71 KB | berdir |
Comments
Comment #1
berdirComment #2
berdirComment #5
wim leersPatch looks great! Just one remark.
No need for this, just
will do.
Comment #6
wim leersComment #10
plachWaiting for a fix for #5 to RTBC
Comment #11
berdirFixed and added a small assert. test-only patch should fail, untested ;)
Comment #14
berdirHm, test-only didn't fail...
Comment #15
plachNeeds work, I guess :(
Comment #16
lauriii"Seems testbot is high and/or drunk." WTF? :D
Comment #17
wim leersI suspect something else on the page is already causing that cache context to be added, which would explain the lack of failures. You could choose to force the
SimplePageVariantto look only at the cacheability of the render array returned by the controller.Comment #18
wim leersConfirmed by applying
content-translation-overview-cacheability-2500013-11-test-only.patchto HEAD, and running this test. It passes. So something else is already adding that cache context.Comment #19
wim leersThe idea in #17 also won't work; this already is using the
SimplePageVariant. So, I don't think there's much more to test here.Comment #20
plachMakes sense, but then why we had test failures in the parent issues?
Comment #21
wim leersI had the same question, so I worked on getting the SmartCache patch applying to HEAD again: #2429617-130: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!). Let's see what the answer is.
Comment #22
wim leersNope, the failures in the translation workflow test still exist: #2429617-130: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!).
Comment #23
wim leersSo, probably the test is not precise enough. I think it needs to be testing for the presence of some other cache context or some cache tag. Let's figure that out.
Comment #24
berdirWe now understand why this is fixing smartcache, debugging it together with @plach and @WimLeers:
It's not cache contexts but the cache tag for the entity that we're displaying the overview for. The confusing part was that the cache tag for the entity was displayed in the headers, but smartcache didn't see it. The reason for this is that the access result is added to the response at the end, but that's after smartcache.
That means it is very hard to write useful test coverage in HEAD, since the test assertions here will not fail and the intermediate cacheability metadata is not available anywhere short of unit tests or some sort of event listener that would then print it out again.
We think that it's fine to get this in without that kind of test coverage, we were mostly worried about not understanding what's happening before.
Comment #25
wim leersComment #26
plachRTBC +1
Comment #27
fabianx commentedRTBC + 1
Comment #28
wim leersBumping to major given that this blocks #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!), which is major.
Comment #29
fabianx commentedAdded beta evaluation.
Comment #30
alexpottCommitted 41cc210 and pushed to 8.0.x. Thanks!
Thanks for adding a beta evaluation.