I'm working with a site which has page cache enabled.
I'd like the page cache for any given node to invalidate when that node is changed. There's a lot of examples out there dealing with cache tags, but I haven't had any luck figuring out the relationship between page caching and cache tags.
I've got a node which starts out being published. I then unpublish it, and publish it again. When I publish it for the second time, the page cache still treats it as unpublished. It does so until i clear the entire (page) cache.
It seems that the cache_page
entry is updated when i update a published node, but whenever the node goes from unpublished to published - the page cache entry doesn't follow.
I've tried implementing hook_entity_update
and do a Cache::invalidateTags(['node:19']);
, but that had no impact.
Is it possible to use cache tags to invalidate page cache entries?
I'd like the page cache for any given node to invalidate when that node is changed.
– that's already built in. But it depends how and where exactly this node is being displayed. You probably need to update your question clarifying that.