Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
4 Jun 2015 at 14:12 UTC
Updated:
8 Jul 2015 at 02:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonI plan to do this in a week or so, but if someone else has time to get to it first, please assign it to yourself and I'll review. Either way, let's just get it done. ;)
Comment #2
wim leersI'll be happy to take this on when I'm back from vacation, next Friday, unless you beat me to it.
Comment #3
jhodgdonOK I'm writing this today...
Comment #4
jhodgdonHow's this? Hopefully not too out of scope, I fixed 1 wrapping issue and 2 broken method reference issues (methods moved from one interface to another and the docs were not updated) in the same topic.
Comment #5
wim leersNeeds reroll after #2401843: Move all *.api.php files except system.api.php out of system module directory. Updated the IS to have a working link too.
Comment #6
wim leersLooks great!
All remarks beside the first two are about the same thing: in the current writing, it seems that the contextual data is only relevant when caching, but that's not true; it's precisely because of the computed data depending on the context, that we must carefully take the used contextual data into account when caching. Otherwise, you end up with cache poisoning!
That's the part I believe needs to be addressed, after that, this is good to go :)
What's the difference between "temporary" and "for a certain timespan"? AFAICT they're the same.
Good call :)
s/cached/computed/
s/The basic idea is that you/When caching such data, you/
s/can cache several variations/must cache every variations separately/
s/data/computed data/
Comment #7
wim leersComment #8
jhodgdonThanks for the review -- good points! How's this?
[The core.api.php file moved to core/core.api.php so had to reroll for that. Interdiff is from that reroll. Though the interdiff is nearly as long as the patch. :) ]
Comment #9
wim leers(Yeah, interdiff is quite useless here :D)
Looks excellent!
Comment #12
wim leersComment #13
jhodgdonIt looks like we should probably add a line or two about how to discover the available cache contexts without going to a drupal.org page that might not be available (on a plane etc.). See #2443323-31: New convention: CacheContextInterface implementations should mention their ID in their class-level docblock
Needs to say that the classes implement CacheContextInterface (with the namespace) and the services are tagged cache.context, and the ID that you need is the service ID minus the prefix.
Comment #14
wim leersIsn't that out of scope for those docs? It links to a page that explains it.
Comment #15
jhodgdonWell, on the other issue I think we concluded (or at least I did ;) ) that it is essential information for developers to have, so I think it merits a sentence at least. Probably a sentence at most also. ;)
Here's a patch/interdiff, to illustrate just how brief I think it can be.
Comment #16
wim leersOh, that is wonderfully concise :)
Comment #17
alexpottDocumentation improvements are permitted in beta. Committed 9812bb2 and pushed to 8.0.x. Thanks!