kiboit / phast
A toolbox for optimizing web page performance
Installs: 13 562
Dependents: 1
Suggesters: 0
Security: 0
Stars: 35
Watchers: 6
Forks: 1
Open Issues: 5
Requires
- php: >=7.2
- ext-json: *
Requires (Dev)
- ext-dom: *
- facebook/webdriver: ^1.5
- friendsofphp/php-cs-fixer: ^2.16
- kiboit/jsmin-php: dev-master
- nikic/php-parser: ^4.13
- phpunit/phpunit: ^9.5
Suggests
- nikic/php-parser: Needed for compilation
- dev-master
- 1.110
- 1.109
- 1.108
- 1.107
- 1.106
- 1.105
- 1.104
- 1.103
- 1.102
- 1.101
- 1.100
- 1.99
- 1.98
- 1.97
- 1.96
- 1.95
- 1.94
- 1.93
- 1.92
- 1.91
- 1.90
- 1.89
- 1.88
- 1.87
- 1.86
- 1.84
- 1.83
- 1.82
- 1.81
- 1.80
- 1.79
- 1.78
- 1.77
- 1.76
- 1.75
- 1.74
- 1.73
- 1.72
- 1.71
- 1.70
- 1.69
- 1.68
- 1.67
- 1.66
- 1.65
- 1.64
- 1.63
- 1.62
- 1.61
- 1.60
- 1.59
- 1.58
- 1.57
- 1.56
- 1.55
- 1.54
- 1.53
- 1.52
- 1.51
- 1.50
- 1.49
- 1.48
- 1.47
- 1.46
- 1.45
- 1.43
- 1.42
- 1.41
- 1.40
- 1.39
- 1.38
- 1.37
- 1.36
- 1.35
- 1.34
- 1.33
- 1.32
- 1.31
- 1.30
- 1.29
- 1.28
- 1.27
- 1.26
- 1.25
- 1.24
- 1.23
- 1.22
- 1.21
- 1.19
- 1.18
- 1.17
- 1.16
- 1.15
- 1.14
- 1.13.0
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-sqlite-cache
This package is auto-updated.
Last update: 2024-11-23 11:21:00 UTC
README
Phast is a unique automated page optimization suite for PHP by Kibo IT.
Phast applies advanced optimization techniques to any PHP-based site without changing any code. Optimizations are applied in such a way that no changes to your site are necessary. Sites optimized by Phast easily score 90+ in Google PageSpeed Insights, and usually reach 100/100 with small adjustments.
A free integration for WordPress is available as PhastPress (GitHub).
Van der Let & Partners have contributed an OctoberCMS plugin for Phast.
Contact Kibo IT (email): We'd love your feedback. We can help you try out Phast and provide custom services for website optimization.
Getting started
Install Phast into your project using Composer:
composer install kiboit/phast:dev-master
Create http://your.site/phast.php
to serve optimized versions of resources:
<?php require 'vendor/autoload.php'; \Kibo\Phast\PhastServices::serve();
Load Phast on all of your pages:
<?php // At the top of your index.php require 'vendor/autoload.php'; \Kibo\Phast\PhastDocumentFilters::deploy();
Test your site!
Features
-
Image optimization: Images are recompressed, optimised (via pngquant and jpegtran) and converted to WebP, when supported by the browser.
-
CSS optimization: We break down included stylesheets and remove all class-based selectors that cannot apply to the current document. The optimised CSS is inlined. After the page has loaded, the original CSS is included, so any classes used in JavaScript will be available.
-
CSS inlining: Small stylesheets (including Google Fonts) get inlined.
-
Delay IFrames: IFrames are loaded after the page finishes, to prevent stealing bandwidth and resources from the main page load.
-
Scripts rearrangement: We move all <script> tags to the bottom of the page, so the important stuff gets loaded first.
-
Scripts deferring: Scripts are loaded asynchronously with full compatibility. To make sure that legacy scripts work while being loaded asynchronously, we use a custom script loader that loads the scripts in order, and triggers DOMContentLoaded when they have finished.
-
Scripts proxy: External scripts such as Google Analytics are loaded through a proxy script. This allows us to extend the cache duration.
Browser compatibility
Phast is tested to work on all browser versions equal or higher than the following:
- Firefox 56
- Chrome 62
- Edge (any version)
- Safari 6.2
- IE 11
Thanks, BrowserStack!
BrowserStack generously provides us with free access to their browser testing platform, so we can make sure Phast works on all supported browsers.