Module bus.http

Class CacheInterceptor

java.lang.Object
org.miaixz.bus.http.cache.CacheInterceptor
All Implemented Interfaces:
Interceptor

public class CacheInterceptor extends Object implements Interceptor
An interceptor that serves requests from the cache and writes responses to the cache.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • CacheInterceptor

      public CacheInterceptor(InternalCache cache)
  • Method Details

    • intercept

      public Response intercept(NewChain chain) throws IOException
      Description copied from interface: Interceptor
      Intercepts the given chain to process a network request.
      Specified by:
      intercept in interface Interceptor
      Parameters:
      chain - The network call chain.
      Returns:
      The Response from the network request.
      Throws:
      IOException - if an I/O error occurs during interception.