codingpaws/cached-components

Speed up Laravel components by caching generated HTML

This package's canonical repository appears to be gone and the package has been frozen as a result.

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

This package is auto-updated.

Last update: 2024-07-19 18:17:28 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');
  }
}