@Override
    public void updateNode(Node node) {
        log.debug( "Updating node: {}", node.getUniqueIdentifier() );

        final List<NodeOperation> operations = nodesToProcess.computeIfAbsent( node.getUniqueIdentifier(), id -> new ArrayList<>() );

        // This update can replace any pending updates (since the last create/delete or affiliation change).
        final ListIterator<NodeOperation> iter = operations.listIterator( operations.size() );
        while ( iter.hasPrevious() ) {
            final NodeOperation operation = iter.previous();
            if ( operation.action.equals( NodeOperation.Action.UPDATE ) ) {
                iter.remove(); // This is replaced by the update that's being added.
            } else {
                break; // Operations that precede anything other than the last operations that are UPDATE shouldn't be replaced.
            }
        }
        operations.add( NodeOperation.update( node ));
    }
Cache for recently accessed published items.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProvider.java