Download the PHP package renatomarinho/laravel-page-speed without Composer

On this page you can find all versions of the php package renatomarinho/laravel-page-speed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-page-speed

Laravel Page Speed logo

Build Status Latest Stable Version Total Downloads License

Laravel Page Speed

Simple package to minify HTML output on demand which results in a 35%+ optimization. Laravel Page Speed was created by Renato Marinho, and currently maintained by João Roberto P. Borges, Lucas Mesquita Borges and Renato Marinho.

Installation

Requires:

You can install the package via composer:

This package supports Laravel Package Discovery.

Publish configuration file

php artisan vendor:publish --provider="RenatoMarinho\LaravelPageSpeed\ServiceProvider"

Do not forget to register middlewares

Next, the \RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class and other middleware must be registered in the kernel, for example:

Middlewares Details

\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class

The RemoveComments::class filter eliminates HTML, JS and CSS comments. The filter reduces the transfer size of HTML files by removing the comments. Depending on the HTML file, this filter can significantly reduce the number of bytes transmitted on the network.

\RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class

The CollapseWhitespace::class filter reduces bytes transmitted in an HTML file by removing unnecessary whitespace. This middleware invoke RemoveComments::class filter before executation.

Note: Do not register the "RemoveComments::class" filter with it. Because it will be called automatically by "CollapseWhitespace::class"

Before

Before of Laravel Page Speed

After

After of Laravel Page Speed

\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class

The RemoveQuotes::class filter eliminates unnecessary quotation marks from HTML attributes. While required by the various HTML specifications, browsers permit their omission when the value of an attribute is composed of a certain subset of characters (alphanumerics and some punctuation characters).

Quote removal produces a modest savings in byte count on most pages.

\RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class

The ElideAttributes::class filter reduces the transfer size of HTML files by removing attributes from tags when the specified value is equal to the default value for that attribute. This can save a modest number of bytes, and may make the document more compressible by canonicalizing the affected tags.

\RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class

The InsertDNSPrefetch::class filter Injects tags in the HEAD to enable the browser to do DNS prefetching.

DNS resolution time varies from <1ms for locally cached results, to hundreds of milliseconds due to the cascading nature of DNS. This can contribute significantly towards total page load time. This filter reduces DNS lookup time by providing hints to the browser at the beginning of the HTML, which allows the browser to pre-resolve DNS for resources on the page.

⚠️ \RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,

The TrimUrls::class filter trims URLs by resolving them by making them relative to the base URL for the page.

Warning: TrimUrls::class is considered medium risk. It can cause problems if it uses the wrong base URL. This can happen, for example, if you serve HTML that will be pasted verbatim into other HTML pages. If URLs are trimmed on the first page, they will be incorrect for the page they are inserted into. In this case, just disable the middleware.

\RenatoMarinho\LaravelPageSpeed\Middleware\InlineCss::class

The InlineCss::class filter transforms the inline "style" attribute of tags into classes by moving the CSS to the header.

\RenatoMarinho\LaravelPageSpeed\Middleware\DeferJavascript::class

Defers the execution of javascript in the HTML.

If necessary cancel deferring in some script, use data-pagespeed-no-defer as script attribute to cancel deferring.


Configuration

After installing package, you may need to configure some options.

Disable Service

You would probably like to set up the local environment to get a readable output.

Skip routes

You would probably like to configure the package to skip some routes.

By default this field comes configured with some options, so feel free to configure according to your needs...

Notice: This package skip automatically 'binary' and 'streamed' responses. See File Downloads.

Testing

Contributing

Please see CONTRIBUTING for details.

Contributors

Inspiration

Mod Page Speed (https://www.modpagespeed.com/)

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-page-speed with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^6.0 || ^7.0 || ^8.0 || ^9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package renatomarinho/laravel-page-speed contains the following files

Loading the files please wait ....