@disable_for_loaddata
def flush_similar_cache_handler(sender, **kwargs):
 entry = kwargs['instance']
 if entry.is_visible:
  EntryPublishedVectorBuilder().cache_flush()

@ disable_for_loaddata def flush_similar_cache_handler ( sender , ** kwargs ) : entry = kwargs [ 'instance' ] if entry . is_visible : EntryPublishedVectorBuilder ( ) . cache_flush ( )
flush the cache of similar entries when an entry is saved .