PHPackages                             rodrigopedra/russian-doll-caching - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rodrigopedra/russian-doll-caching

ActiveLibrary

rodrigopedra/russian-doll-caching
=================================

Laravel Russian Doll Caching

v2.0.0(8y ago)883MITPHP

Since Feb 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rodrigopedra/russian-doll-caching)[ Packagist](https://packagist.org/packages/rodrigopedra/russian-doll-caching)[ RSS](/packages/rodrigopedra-russian-doll-caching/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

Russian Doll Caching for Laravel 5.3, 5.4, 5.5 and 5.6
======================================================

[](#russian-doll-caching-for-laravel-53-54-55-and-56)

Efficient view caching.

Inspired by the excellent series at  .

Watch that series to understand the concepts around it and to use it properly, for example: how to invalidate the cache upwards.

Installation
------------

[](#installation)

In your terminal/shell run:

```
composer require rodrigopedra/russian-doll-caching

```

If you're using Laravel 5.3 or 5.4 you need to register the service provider in your `config/app.php` providers array:

```
// ...

'providers' => [
    // ...

    RodrigoPedra\RussianDollCaching\RussianDollCachingServiceProvider::class,
],

// ...
```

Configuration
-------------

[](#configuration)

In your terminal/shell run:

```
php artisan vendor:publish --provider="RodrigoPedra\RussianDollCaching\RussianDollCachingServiceProvider"

```

You can configure a `should_cache` constraint, so you can skip caching, for example, while developing locally.

Usage
-----

[](#usage)

Use the `@russian` directive in your blade templates the same way you would use the `@include` directive.

You can optionally inform a custom prefix that will be prepended to the cache key.

```
    @russian('path.to.view', compact('user', 'articles'), 'version-prefix')

    @russian('path.to.other.view', compact('user', 'articles'))

    {{-- caution here, the cache key will only be the view name hash! --}}
    @russian('path.to.another.view')
```

You can also pass multiple prefixes as an `array`, that will be prepended to the cache item's key:

```
    @russian('path.to.other.view', compact('user'), [ 'v1', 'home' ])
```

If your cache mechanism supports tagging, like `memcached` or `redis`, all cache items will be cached with a `russian` tag.

### Key calculation

[](#key-calculation)

The caching mechanism will try to use the first element in the `data` array as part of the cache key.

You should use the `RussianCacheableModel` trait in your models or use the `RussianCacheableCollection` in your custom collections. This traits add a `getCacheKey` method to this objects so you can

FAQ
---

[](#faq)

- Why are my views not updating?

    Try running `php artisan view:clear` and `php artisan cache:clear`. Also, while developing, set the `should_cache`config key to `false`.
- Can I flush just the items cached by this package?

    If you use a caching mechanism that supports tagging (`memcached` or `redis`) all the cached items are created with a `russian` tag. So you can clear only these items running `\Cache::tags('russian')->flush()` in `php artisan tinker`

### License

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Recently: every ~184 days

Total

10

Last Release

3008d ago

Major Versions

v0.1 → v1.02016-02-11

v1.3.3 → v2.0.02018-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/28b79e134ef3cb5144da8f2c5af057533fcdf0afc1b7b083e8eafbbc8ee08a67?d=identicon)[rodrigo.pedra](/maintainers/rodrigo.pedra)

---

Top Contributors

[![rodrigopedra](https://avatars.githubusercontent.com/u/5470108?v=4)](https://github.com/rodrigopedra "rodrigopedra (19 commits)")

---

Tags

laravelrodrigopedrarussian doll caching

### Embed Badge

![Health badge](/badges/rodrigopedra-russian-doll-caching/health.svg)

```
[![Health](https://phpackages.com/badges/rodrigopedra-russian-doll-caching/health.svg)](https://phpackages.com/packages/rodrigopedra-russian-doll-caching)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
