Problem/Motivation
We have very nice caching capability and nice docs at https://www.drupal.org/developing/api/8/render/arrays/cacheability (linked from https://www.drupal.org/developing/api/8/cache even) but even this can be made better.
Proposed resolution
Both https://www.drupal.org/developing/api/8/render/arrays/cacheability and https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21... needs a list of things you can pass to addCacheableDependency . For example , I didn't know config can be added.
http://wimleers.com/talk-making-drupal-fly-fastest-drupal-ever-near/ should be brought to drupal.org -- if the video doesn't come over that's fine IMO, I learned a lot without the video even.
Comments
Comment #1
Wim Leers+1, thanks for creating this issue!
I'm planning to work on this this week.
Comment #2
Wim LeersOne small improvement already: #2527126-28: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them.
Comment #3
Wim LeersRewrote https://www.drupal.org/developing/api/8/cache/tags, and gave it a clean URL consistent with the others.
Comment #4
Wim LeersAlso created https://www.drupal.org/developing/api/8/cache/max-age.
Comment #5
Wim LeersCleaned up the child pages of https://www.drupal.org/developing/api/8/cache; the remaining ones are all solid (they're the ones mentioned in #3 + #4, plus https://www.drupal.org/developing/api/8/cache/contexts, which I've also updated slightly to be in sync with the two others, structure-wise).
Filed #2541432: Follow-up for #2231595: Document why ChainedFastBackend cannot use BackendChain because that is quite confusing ATM.
Comment #6
Wim LeersCreated https://www.drupal.org/documentation/modules/smart_cache and updated/rewrote https://www.drupal.org/documentation/modules/internal_page_cache.
Comment #7
Wim LeersRewrote https://www.drupal.org/developing/api/8/cache.
Next: work on documenting
CacheableDependencyInterface
+addCacheableDependency()
.Comment #8
Wim LeersBut https://www.drupal.org/developing/api/8/render/arrays/cacheability#concr... has been mentioning this all along. In the code example, we even specifically call
addCacheableDependency($render_array, $config)
.AFAICT you simply hadn't read that yet?
Comment #9
chx CreditAttribution: chx commentedTrue. I haven't caught that. Sorry. Nonetheless such a list on https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21... would be desirable I guess?
Comment #10
Wim LeersNow also created https://www.drupal.org/developing/api/8/cache/cacheable-dependency-inter.... That should address the remaining concerns.
Making one last pass now.
Comment #11
Wim LeersMade that last pass; AFAICT we're in a pretty good place now. If you have further concrete suggestions, let me know.