You may enable API level caching with the ApiCache
middleware:
// app/Http/Kernel.php
protected $middlewareGroups = [
'api' => [
...
\Streams\Api\Http\Middleware\ApiCache::class,
],
];
You may control the API cache with the following headers:
To force fresh results use the no-cache
directive:
Cache-Control: no-cache
Use the max-age
directive to allow cached results for a certain amount of seconds:
Cache-Control: max-age=600
Streams may be cached by default at the application level according to their configuration.
Application-level streams cache can be specified in the stream configuration:
//streams/examples.json
{
"config": {
"cache": {
"enabled": true,
"store": "default",
"ttl": 3600
}
}
}
You may enable application-level cache using the cache
parameter:
// GET /api/streams/examples/entries
{
"parameters": [
{"cache": [300]}
{"where": ["status", "active"]}
]
}
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.