PHPackages                             facile-it/zf-link-headers-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. facile-it/zf-link-headers-module

Abandoned → [facile-it/laminas-link-headers-module](/?search=facile-it%2Flaminas-link-headers-module)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

facile-it/zf-link-headers-module
================================

Zend Framework module to push Link headers for resourcers added with HeadLink view helper

0.2.1(8y ago)315.8k1MITPHPPHP ^7.0

Since Dec 7Pushed 8y ago2 watchersCompare

[ Source](https://github.com/facile-it/zf-link-headers-module)[ Packagist](https://packagist.org/packages/facile-it/zf-link-headers-module)[ Docs](https://github.com/facile-it/zf-link-headers-module)[ RSS](/packages/facile-it-zf-link-headers-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (4)Used By (0)

ZFLinkHeadersModule
===================

[](#zflinkheadersmodule)

[![Travis](https://camo.githubusercontent.com/2f4458948edb0776cf55b0b2ed905d9570b97a24ed0c2707e940200c86c208e2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f666163696c652d69742f7a662d6c696e6b2d686561646572732d6d6f64756c652e737667)](https://travis-ci.org/facile-it/zf-link-headers-module)[![Scrutinizer Coverage](https://camo.githubusercontent.com/7d7428f3a64c7dd571486f9aa229f2dc85dc30ab21faee0adece6fe2eabbf81c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f666163696c652d69742f7a662d6c696e6b2d686561646572732d6d6f64756c652e737667)](https://scrutinizer-ci.com/g/facile-it/zf-link-headers-module/)[![Scrutinizer](https://camo.githubusercontent.com/45e17349bd48f7063de74676c924b908c1a2b088686344d36ce22e0f533f14b0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f666163696c652d69742f7a662d6c696e6b2d686561646572732d6d6f64756c652e737667)](https://scrutinizer-ci.com/g/facile-it/zf-link-headers-module/)[![GitHub release](https://camo.githubusercontent.com/917632b2cd9bed99bf1fc7d6cb0664fb8dd87e5462727adfd3e7a2eef9409b7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f666163696c652d69742f7a662d6c696e6b2d686561646572732d6d6f64756c652e737667)](https://github.com/facile-it/zf-link-headers-module)

This module will automatically sends `Link` HTTP headers supporting [resource hints](https://www.w3.org/TR/resource-hints/)and [preload](https://www.w3.org/TR/preload/), via HTTP headers.

Currently supported hints
-------------------------

[](#currently-supported-hints)

From [`OptionsInterface`](src/OptionsInterface.php):

```
const MODE_PRELOAD = 'preload';
const MODE_PREFETCH = 'prefetch';
const MODE_DNS_PREFETCH = 'dns-prefetch';
const MODE_PRECONNECT = 'preconnect';
const MODE_PRERENDER = 'prerender';
```

Configuration
-------------

[](#configuration)

This is the default configuration and options can be overridden in your configuration.

```
return [
    'facile' => [
        'zf_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
        ],
    ],
];
```

Example
-------

[](#example)

### Configuration:

[](#configuration-1)

Default configuration:

```
return [
    'facile' => [
        'zf_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
        ],
    ],
];
```

### Template

[](#template)

In your template:

```
DOCTYPE html>
