Besides Laravel cache you may use domain-linked caching. Domain-linked caching is similar to caching with tags but automated around configured streams.


Domain-linked caching uses the default Laravel storage driver.

Basic Usage

You can interact with domain-linked cache stores directly using stream instances.

Inserting Items

You can insert an item into domain-linked cache for a given number of seconds using the cache method:

Streams::make('contacts')->cache('favorites', 600, function() {
    return $this->entries()->where('favorited', true)

Retrieving Items

You can retreive cached items using the cached method:

$favorites = Streams::make('contacts')->cached('favorites');

Forgetting Items

You can forget a specific domain-linked cached item using the forget method:


You can forget all domain-linked cached items for a stream using the flush method:


Write operations automatically forget/flush cache.

Related Documentation