class_docstr: Protocol for cacheable graph component outputs.
  
  We only cache graph component outputs which are `Cacheable`. We only store the
  output fingerprint for everything else.
class_docstr_tok: ["Protocol","for","cacheable","graph","component","outputs",".","We","only","cache","graph","component","outputs","which","are","`","Cacheable","`",".","We","only","store","the","output","fingerprint","for","everything","else","."]
docstr: Persists `Cacheable` to disk.
  
  Args:
      directory: The directory where the `Cacheable` can persist itself to.
      model_storage: The current model storage (e.g. used when caching `Resource`
          objects.
docstr_tok: ["Persists","`","Cacheable","`","to","disk",".","Args",":","directory",":","The","directory","where","the","`","Cacheable","`","can","persist","itself","to",".","model_storage",":","The","current","model","storage","(","e.g",".","used","when","caching","`","Resource","`","objects","."]
code: def to_cache(
      self, directory: Path, model_storage: ModelStorage
  ) -> None:
      """Persists `Cacheable` to disk.
  
      Args:
          directory: The directory where the `Cacheable` can persist itself to.
          model_storage: The current model storage (e.g. used when caching `Resource`
              objects.
      """
      ...
  
imports: from __future__ import annotations
  import abc
  import logging
  import os
  import shutil
  from datetime import datetime
  from pathlib import Path
  from typing import Text, Any, Optional, Tuple, List
  from packaging import version
  from sqlalchemy.engine import URL
  from sqlalchemy.exc import OperationalError
  from typing_extensions import Protocol, runtime_checkable
  import rasa
  import rasa.model
  import rasa.utils.common
  import rasa.shared.utils.common
  from rasa.constants import MINIMUM_COMPATIBLE_VERSION
  import sqlalchemy
  import sqlalchemy.orm
  from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
  from rasa.engine.storage.storage import ModelStorage
label_desc: Use image node_id 1 for calling the Cacheable obj's underlying member method code with example usage: obj.to_cache(directory, model_storage) without return types