b13/http2

Speed up TYPO3 rendering via HTTP/2 Server Push

Installs: 2 912

Dependents: 0

Suggesters: 0

Stars: 6

Watchers: 9

Forks: 1

Open Issues: 2

Type:typo3-cms-extension

1.0.0 2019-08-27 09:27 UTC

README

Latest Version on Packagist Software License Build Status

This TYPO3 extension fetches all CSS and JS resources that are used for a page-rendering and sends additional HTTP/2 Headers "Link" for each resource resulting in a faster first contentful paint for TYPO3 CMS.

This extension currently runs on TYPO3 v7 LTS, TYPO3 v8 LTS and TYPO3 v9 LTS.

Installation

Just use composer req b13/http2 and install the extension via the Extension Manager, flush caches and you're ready to go.

In order to see if the extension works, ensure that your webserver supports HTTP/2, runs via HTTPS and check your Response headers to see if "link: " headers are added to your HTTP response.

Nothing to configure, it just works(tm).

Requirements

You need a webserver with HTTP/2 support, and - of course - HTTPS.

Also, use PHP7 - if you care about performance or supported PHP versions, there is nothing to discuss.

How it works under the hood

  1. Hook into the "PageRenderer" API class by fetching the concatenated CSS / JS files, and libraries.
  2. If in FE, this is stored within TSFE together with cached data (could be run twice here for non-cached info)
  3. Send to the client via header() - in BE directly or in FE at the end of the request.

ToDo

  • Use Middlewares and PSR-7 for TYPO3 v9
  • Implement options to also allow to define other resources (fonts/images), e.g. via TypoScript.
  • Use proper DTOs instead of arrays.

Credits

License

As this is a PHP project, extending TYPO3, all code is licensed as GPL v2+.