Skip to main content

Caching the Routes

It is possible to cache the routes generated by OpenApiRouteList by passing any PSR-16 instance to withCache():

<?php
$routeDefinition = new OpenApiRouteList(__DIR__ . '/swagger.json');
$routeDefinition->withCache(new FileSystemCacheEngine());