@Override
    public void purgeNode( final LeafNode leafNode )
    {
        // If there are any pending items for this node, don't bother processing them.
        synchronized (itemsPending) {
            itemsPending.values().removeIf( publishedItem -> leafNode.getUniqueIdentifier().equals( publishedItem.getNode().getUniqueIdentifier() ) );
            itemsToAdd.removeIf( publishedItem -> leafNode.getUniqueIdentifier().equals( publishedItem.getNode().getUniqueIdentifier() ) );
            itemsToDelete.removeIf( publishedItem -> leafNode.getUniqueIdentifier().equals( publishedItem.getNode().getUniqueIdentifier() ) );
        }

        // drop cached items for purged node
        synchronized (itemCache)
        {
            for (PublishedItem item : itemCache.values())
            {
                if (leafNode.getUniqueIdentifier().equals(item.getNode().getUniqueIdentifier()))
                {
                    itemCache.remove(item.getUniqueIdentifier());
                }
            }
        }
        delegate.purgeNode( leafNode );
    }
Cache for recently accessed published items.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProvider.java