class ClearCacheController implements RequestHandlerInterface

Clears the cache, reporting each step as it finishes.

The work recompiles every asset bundle for every frontend and locale, which is tens of seconds where the assets live on remote storage. Waiting until the end to answer leaves the admin watching a spinner with no way to tell a slow clear from a dead request, so the steps are streamed as newline-delimited JSON — one object per line, each complete in itself. Only the body streams. Authorisation, CSRF, throttling and error handling all still come from the API middleware: those wrap the response object, and it is the emitter that consumes the body, so a {\Laminas\Diactoros\CallbackStream} passes through them untouched and is streamed by {\Flarum\Http\Emitter} at the end.

Methods

__construct(CacheClearCommand $command, AssetsPublishCommand $assetsPublishCommand)

No description

ResponseInterface
handle(ServerRequestInterface $request)

No description

Details

__construct(CacheClearCommand $command, AssetsPublishCommand $assetsPublishCommand)

Parameters

CacheClearCommand $command
AssetsPublishCommand $assetsPublishCommand

ResponseInterface handle(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface