codingpaws/cached-components

Speed up Laravel components by caching generated HTML

v2.0 2022-08-19 14:12 UTC

This package is auto-updated.

Last update: 2024-05-19 17:57:59 UTC


README

Speed up your Laravel app through cached components! ⚡🏃

Blade components can slow down large applications significantly, especially if they are recursively rendered. To improve that, cached-components ships with a custom blade compiler that prevents re-rendering of components if they are cachable.

Getting started

On your blade components, replace extends Component with extends CachedComponent and import the class.

use CodingPaws\CachedComponents\CachedComponent;

class MyComponent extends CachedComponent {
  public function render() {
    return view('components.my-component');
  }
}