Download the PHP package innoge/laravel-speculation-rules-api without Composer
On this page you can find all versions of the php package innoge/laravel-speculation-rules-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innoge/laravel-speculation-rules-api
More information about innoge/laravel-speculation-rules-api
Files in innoge/laravel-speculation-rules-api
Package laravel-speculation-rules-api
Short Description A Laravel package as streamlined solution to utilize the speculation rules api.
License MIT
Homepage https://github.com/innoge/laravel-speculation-rules-api
Informations about the package laravel-speculation-rules-api
Laravel Speculation Rules API
This Laravel package provides a streamlined solution to utilize the Speculation Rules API, allowing you to speed up your website performance significantly.
[!NOTE] The Speculation Rules API is an experimental technology.
Further information can be found at the MDN Web Docs.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Add the following Blade directive inside the head
tag.
Usage
To prerender or prefetch a route, simply add the prerender
or prefetch
method to the route definition.
The level of eagerness
can be passed as a parameter to the prerender
and prefetch
method, e.g.:
Prerender/Prefetch
If you prerender an url, all resources will be fetched and the DOM will be rendered in the background. This will avoid most of the layout shifts you had before. If you prefetch a page, only the resources will be fetched. This can lead to a much faster page load.
For more information refer to the following pages:
Eagerness Levels (available as of Chrome 122)
eager
Immediately prerender/prefetch the URL.moderate
Prerender/prefetch on link hover.conservative
Prerender/prefetch only on link click.
Alternatively you can utilize the Speculation Rules API through the package configuration, e.g.:
For further information on the available options, please refer to the MDN Web Docs.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Daniel Seuffer
- Tim Geisendoerfer
- All Contributors ❤️
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-speculation-rules-api with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.14.0