My Blog Posts

Laravel Page Speed Package

Laravel Page Speed Package

Laravel Page Speed is a package renato marinho does to automatically optimize your site. Page Speed is inspired by Google's mod_pagespeed and offers the following options:

  • inline_css reduces external CSS files
  • elide_attributes Removes unnecessary features from HTML tags
  • insert_dns_prefetch adds tags to HEAD to enable the browser to pre-fetch DNS
  • remove_quotes Removes unnecessary quotation marks on HTML tags
  • trim_urls Removes unnecessary prefixes from URLs
  • collapse_whitespace Removes unnecessary spaces in HTML
  • remove_comments Removes HTML comments

On the package's roadmap, combine_cssmerge multiple CSS files into a single file and combine_javascriptJavaScript does it in files.

Optimizations work by defining a middleware software that you can group to apply to a route or route group for each rule.

You can run Routes by defining them in the configuration file that came with the package:

'skip' => [
'*.pdf', // Ignore all routes with final .pdf
'*/downloads/*',// Ignore all routes that contain 'downloads'

To use this package and for more information, go to the github pageand go to thevel Page Speed

Share this article

Comments (0)