Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Major
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
20 Sep 2013 at 19:19 UTC
Updated:
29 Jul 2014 at 22:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
catchComment #2
wim leersYes yes yes yes yes +1000.
Comment #3
moshe weitzman commentedThis turned out to be pretty straightforward. We only have access to the processed page array during drupal_render_page() so we have to calculate and stash away our list of tags at that time. I chose to add a #post_render callback at the top level of the $page array and do collection and storage of tags there. We then fetch those collected tags later during drupal_page_set_cache().
We were not correctly tagging nodes with their author's uid so I fixed that line in this patch. It was giving an error.
Comment #4
moshe weitzman commentedBetter code comments.
Comment #6
wim leers#4: drupal8.base-system.2094241-4.patch queued for re-testing.
Comment #7
wim leersFixing nitpicks.
Comment #8
amateescu commentedShouldn't we default to an array here instead of false? Just like in drupal_cache_tags_page_get().
Since $entity is actually a class that implements NodeInterface, we should use $entity->getAuthorId().
Comment #9
amateescu commentedMy review points are trivial, I think this is ready to go.
Comment #10
wim leersSorry, to un-RTBC, but this still needs tests.
Comment #11
amateescu commentedMy view on testing was that we don't need them at the moment because there's nothing to break here, we either get some cache tags from a render array or we don't.
Now, if we want to go further and remove the 'content' cache tag, that will definitely need testing.
Comment #12
catchIt would be lovely to remove the 'content' cache tag, not sure if that should happen in this issue. And we'd need to ensure that cache tags for all entities rendered get correctly added to the page cache and that it gets cleared by two or more in a functional test I think, but yeah that somewhat depends on removing the content tag if it'll be at all realistic.
Comment #13
moshe weitzman commentedThanks for the feedback and rerolls. Here is a new patch with a test.
Comment #15
moshe weitzman commentedReroll
Comment #16
moshe weitzman commentedActually this one
Comment #17
moshe weitzman commentedWe are green now, with a proper web test. Anyone care to review and RTBC?
Comment #18
amateescu commentedReally minor point :) "Tests that cache tags ..."
This procedural wrapper is marked as deprecated, we should use
Cache::invalidateTags()directly instead.This new tag doesn't seem to be used or invalidated anywhere, shouldn't we remove it?
Comment #19
moshe weitzman commentedGood catches. Fixed all those.
Comment #21
amateescu commentedLooks good now :)
Comment #22
wim leersYep, looks good :)
Comment #23
catchCommitted/pushed to 8.x, thanks!
I opened #2124957: Replace 'content' cache tag with 'rendered' and use it sparingly for content cache tag removal.