InvalidateCacheEvent example

$request = new Request();
        $request->attributes->set(RequestTransformer::ORIGINAL_REQUEST_URI, '/foo');
        $store->write($requestnew Response());
    }

    public function testInvoke(): void
    {
        $gateway = $this->createMock(AbstractReverseProxyGateway::class);
        $gateway->expects(static::once())->method('invalidate')->with(['foo']);
        $store = new ReverseProxyCache($gateway$this->createMock(CacheTracer::class)[]);
        $store(new InvalidateCacheEvent(['foo']));
    }
}

        foreach ($this->adapters as $adapter) {
            if ($adapter instanceof TagAwareAdapterInterface) {
                $adapter->invalidateTags($keys);
            }
        }

        foreach ($this->adapters as $adapter) {
            $adapter->deleteItems($keys);
        }

        $this->dispatcher->dispatch(new InvalidateCacheEvent($keys));
    }
}
Home | Imprint | This part of the site doesn't use cookies.