Caching
New in 0.13.27
Generating an OpenAPI document analyzes your application’s routes, controllers, request validation, and response types — this takes time. Cache the generated document so Scramble does not analyze your code on every request. This is especially useful when serving documentation in staging or production.
Cache and clear the cache
Run scramble:cache to cache the OpenAPI document:
php artisan scramble:cacheWhen a cached document is available, both the documentation UI and JSON specification route use it instead of generating the specification again.
Clear the cache:
php artisan scramble:clearBoth commands handle every registered API by default. Target one API with --api:
php artisan scramble:cache --api=internalphp artisan scramble:clear --api=internalConfigure the cache
Set a cache key and Laravel cache store in config/scramble.php:
'cache' => [ 'key' => 'scramble.openapi', 'store' => 'file', // or redis, database, and so on],