PHP code example of facile-it / laminas-link-headers-module
1. Go to this page and download the library: Download facile-it/laminas-link-headers-module library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
facile-it / laminas-link-headers-module example snippets
public const MODE_PRELOAD = 'preload';
public const MODE_PREFETCH = 'prefetch';
public const MODE_DNS_PREFETCH = 'dns-prefetch';
public const MODE_PRECONNECT = 'preconnect';
public const MODE_PRERENDER = 'prerender';
return [
'facile' => [
'laminas_link_headers_module' => [
'stylesheet_enabled' => false, // send link headers for stylesheet links
'stylesheet_mode' => 'preload', // resource hint for stylesheet links
'script_enabled' => false, // send link headers for scripts
'script_mode' => 'preload', // resource hint for script links
'http2_push_enabled' => true, // if disabled, a "nopush" attributed will be added to disable HTTP/2 push
],
],
];
return [
'facile' => [
'laminas_link_headers_module' => [
'stylesheet_enabled' => false, // send link headers for stylesheet links
'stylesheet_mode' => 'preload', // resource hint for stylesheet links
'script_enabled' => false, // send link headers for scripts
'script_mode' => 'preload', // resource hint for script links
'http2_push_enabled' => true, // if disabled, a "nopush" attributed will be added to disable HTTP/2 push
],
],
];