Laravel Page Speed is a package by Renato Marinho for optimizing your Laravel site automatically. Page Speed is inspired by Google’s mod_pagespeed, and providing the following options:
inline_cssinlines small external CSS files
elide_attributesremoves unnecessary attributes in HTML tags
insert_dns_prefetchinjects tags in the HEAD to enable the browser to do DNS prefetching
remove_quotesremoves unnecessary quotes in HTML tags
trim_urlsremoves unnecessary prefixes from URLs
collapse_whitespaceremoves unnecessary whitespace in HTML
remove_commentsremoves HTML comments
More options are on the package’s roadmap, such as
combine_css to combine multiple CSS files into one, and
The optimizations work by defining a middleware for each rule, which you could group in order to apply them to a route or group of routes.
You can skip routes by defining them in the configuration file that ships with the package:
1'skip' => [2 '*.pdf', // Ignore all routes with final .pdf3 '*/downloads/*',// Ignore all routes that contain 'downloads'4]
Check out the Laravel Page Speed official repository for more information on installing this package and contributing to the planned rules.