PHPackages                             kirksfletcher/pagespeed - 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. kirksfletcher/pagespeed

ActiveLibrary

kirksfletcher/pagespeed
=======================

Automatic view optimisation and caching system for Laravel rendered views

0.3.3(7y ago)348[1 issues](https://github.com/KirksFletcher/pagespeed/issues)MITPHP

Since May 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/KirksFletcher/pagespeed)[ Packagist](https://packagist.org/packages/kirksfletcher/pagespeed)[ RSS](/packages/kirksfletcher-pagespeed/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

Laravel Pagespeed (for Laravel 5.7 and up)
==========================================

[](#laravel-pagespeed-for-laravel-57-and-up)

Pagespeed is a simple package to apply filters to the view output such as removing whitespace and comments (a lot more to come). The benefit is quite considerable page speed increase, great if you are looking to increase score on Google's Pagespeed Insights, and even better for a smooth user experience.

In addition to applying selected filters, rendered views are cached using the cache configuration you have set-up in Laravel (I recommend using memcached). This allows for lightning fast rendering and delivery of pages.

Obviously while this is good for static pages such as homepage, contact us etc, this will prevent the use of pages with dynamic content. However, if a user is logged in the package will skip serving the cached page and serve a dynamic page (still applying filters).

### Installation

[](#installation)

```
composer require kirksfletcher/pagespeed

```

### Usage is simple:

[](#usage-is-simple)

Whilst you are free to choose your own implementation method, here is the one I like to use.

In your main Controller.php instantiate the Pagespeed class, and select required filters.

```
