Package io.vertx.httpproxy.spi.cache

## Interface Cache

-     @Unstable
      public interface Cache

  Cache SPI.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Future<Resource>` | `get​(String key)` | Being called when the proxy attempts to fetch a cache item.
    `Future<Void>` | `put​(String key, Resource value)` | Being called when the proxy attempts to add a new cache item.
    `Future<Void>` | `remove​(String key)` | Being called when the proxy attempts to delete a cache item, typically caused by invalidating an existing item.

- - ### Method Detail

    - #### put

          Future<Void> put​(String key,
                           Resource value)

      Being called when the proxy attempts to add a new cache item. The cache can only store up to maxSize of the latest items based on CacheOptions.
      Parameters:
        `key` - the URI of the resource
        `value` - the cached response
      Returns:
        a succeed void future

    - #### get

          Future<Resource> get​(String key)

      Being called when the proxy attempts to fetch a cache item.
      Parameters:
        `key` - the URI of the resource
      Returns:
        the cached response, null if not exist, should all wrap with future

    - #### remove

          Future<Void> remove​(String key)

      Being called when the proxy attempts to delete a cache item, typically caused by invalidating an existing item. Do nothing if not exist.
      Parameters:
        `key` - the URI of the resource
      Returns:
        a succeed void future