Class CacheController

java.lang.Object
io.micronaut.controlpanel.panels.cache.CacheController

@Controller("/cache-control-panel-controller") @ExecuteOn("blocking") @Internal public final class CacheController extends Object
REST controller for cache management operations in the Micronaut Control Panel. Provides endpoints for invalidating cache entries and entire caches.
Since:
2.0.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • CacheController

      public CacheController(ControlPanelRepository repository)
      Constructor.
      Parameters:
      repository - the control panel repository
  • Method Details

    • invalidateAll

      @Delete("/{cacheName}") public io.micronaut.http.HttpResponse<Void> invalidateAll(String cacheName)
      Invalidates all entries in the specified cache.
      Parameters:
      cacheName - the name of the cache to invalidate
      Returns:
      HTTP 204 No Content if successful, HTTP 404 Not Found if cache not found
    • invalidate

      @Delete("/{cacheName}/{key}") public io.micronaut.http.HttpResponse<Void> invalidate(String cacheName, String key)
      Invalidates a specific entry in the specified cache.
      Parameters:
      cacheName - the name of the cache
      key - the key of the entry to invalidate
      Returns:
      HTTP 204 No Content if successful, HTTP 404 Not Found if cache not found