perturbatio/cachetags
Larablocks Analysis
perturbatio/cachetags works with Laravel 6, 7 and 8 (latest release v2.1.0, Jul 29, 2022), all past end of life (the last on Jan 24, 2023): no more fixes, even for security.
Laravel 5 in earlier releases.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 6, 7 and 8, past end of life since Jan 24, 2023
- No release in the last 12 months (last: Jul 29, 2022)
- 0 downloads a month (needs 10,000)
- 2 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jul 29, 2022.
- No releases in the last 12 months.
- First released: Sep 17, 2016.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.
| Install | |
|---|---|
composer require perturbatio/cachetags |
|
| Latest Version: | v2.1.0 |
| Laravel: | 6 · 7 · 8 |
| Older releases: | 5 |
| License: | MIT |
| Last Updated: | Dec 28, 2022 |
| Links: | GitHub · Packagist |
CacheTags - Laravel blade partial caching
This package is intended to allow you to cache portions of a web page by marking them using blade directives.
You can specify how long the partial will be cached for as well as naming it (to allow you to invalidate it if needed).
Nesting cacheTags is also possible, meaning that inner content will be cached at least as long as the outer cache is
Installation
Install it as a composer package with:
composer require perturbatio/cachetags
Add Perturbatio\CacheTags\CacheTagsProvider::class to your config/app.php providers array
Add 'CacheTags' => Perturbatio\CacheTags\CacheTags::class to your aliases
Then publish the config file with php artisan vendor:publish --tag=config this will create a cachetag.php config file in /config
Usage
Caching items
Blade
@cachetagStart('super-cool-widget', 15) <!-- widget cached for 15 minutes -->
<?=superCoolWidgetThatTakesTooLongToGenerate();?>
@cachetagStart('other-cool-widget', 'forever') <!-- widget cached until something clears it, nested inside the outer cache -->
<?=otherCoolWidgetThatTakesTooLongToGenerate();?>
@cachetagEnd()
@cachetagEnd()
PHP
if ( cachetagHas('super-cool-widget') ){
echo cachetagGet('super-cool-widget');
} else {
cachetagStart('super-cool-widget', 15);
echo superCoolWidgetThatTakesTooLongToGenerate();
if ( cachetagHas('other-cool-widget') ){
echo cachetagGet('other-cool-widget');
} else {
cachetagStart('other-cool-widget', 'forever'); //widget cached until something clears it, nested inside the outer cache
echo otherCoolWidgetThatTakesTooLongToGenerate();
echo cachetagEnd();
}
echo cachetagEnd();
}
Clearing items
Blade
@cachetagClear('super-cool-widget')
PHP
//clear the cache for a specific key
cachetagClear('super-cool-widget');
if ( $otherCoolWidgetNeedsCacheInvalidated ){ //conditionally clear the
cachetagClear('other-cool-widget');
}
Related Packages
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| v2.1.0 | ^6| | MIT | |
| v2.0.0 | ^6| | MIT | |
| v1.2.0 | ^5.1 | MIT | |
| v1.1.1 | ^5.1 | MIT | |
| v1.1 | ^5.1 | MIT | |
| v1.0.2 | ^5.3 | MIT | |
| v1.0.1 | ^5.3 | MIT | |
| v1.0 | ^5.3 | MIT |