Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlight/pagespeed
Garden plugin.
https://github.com/unlight/pagespeed
Last synced: 6 days ago
JSON representation
Garden plugin.
- Host: GitHub
- URL: https://github.com/unlight/pagespeed
- Owner: unlight
- Created: 2011-02-28T08:25:20.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-08-11T07:17:32.000Z (over 12 years ago)
- Last Synced: 2024-04-10T09:58:07.705Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
DESCRIPTION
===========
Minimizes payload size (compressing css/js files), minimizes round-trip times
(loads JQuery library from CDN, combines external JavaScript/CSS files).
Inspired by Google Page Speed rules.BEFORE INSTALL DISABLE ALL OTHER PLUGINS WHICH DOING THE SAME (such as Minify, etc.)
WHAT THIS PLUGIN DO?
====================
Try to apply Google web performance best practices.
http://code.google.com/speed/page-speed/docs/rules_intro.htmlGOOGLE WEB PERFORMANCE BEST PRACTICES
Combine external CSS [DONE]
Minify CSS [DONE]
Avoid CSS @import [DONE]
Combine external JavaScript [DONE]
Minify JavaScript [DONE]
Enable compression [DONE]
Leverage browser caching [SERVER JOB]
Parallelize downloads across hostnames [DONE]
Remove unused CSS [DEVELOPER JOB]
Use efficient CSS selectors [VANILLA ALREADY]
Minify HTML [VANILLA ALREADY]
Optimize images [DEVELOPER JOB]
Specify image dimensions [DONE]
Avoid bad requests [DEVELOPER JOB]
Combine images into CSS sprites [TODO, DEVELOPER JOB]
Inline Small CSS [NO NEED]
Inline Small JavaScript [NO NEED]
Minimize DNS lookups [VANILLA USE URL PATHS]
Minimize redirects [?]
Minimize request size [VANILLA IS GOOD HERE]
Optimize the order of styles and scripts [VANILLA ALREADY]
Specify a Vary: Accept-Encoding header [SERVER JOB]
Prefer asynchronous resources [?]
Put CSS in the document head [VANILLA ALREADY]
Remove query strings from static resources [DONE]
Serve resources from a consistent URL [?]
Serve scaled images [?]
Specify a cache validator [?]
Specify a character set early [?]
Defer loading of JavaScript (Put JavaScript at bottom) [DONE]WHAT THIS PLUGIN CAN DO?
========================1. Loads JQuery library from CDN Google server.
2. Minify JavaScript
WARINING! Javascript files minifed by remote service http://marijnhaverbeke.nl/uglifyjs
Your web-server must support sockets or curl library.
UglifyJS is a JavaScript parser / mangler / compressor / beautifier library for NodeJS.
3. Combine external JavaScript
Combined in three groups library, applications and plugins.
Or all in one (see configuration section).
4. Avoid CSS @import
If you have custom theme. You may have such style.css, for example:
@import url('reset.css');
@import url('typography.css');
@import url('menu.css');
@import url('activity.css');
@import url('errors.css');
All these css files will be merge to one.
5. Enable compression
Usually it is server job. Apache/mod_deflate
If your server has deflate_module add in .htaccess file:
SetOutputFilter DEFLATE
If no deflate_module, add following lines in your .htaccess file to enable compression
for CSS and JS files:
ForceType application/x-httpd-php
php_value auto_prepend_file "/absolute/path/to/vanilla/plugins/PageSpeed/gzip.handler.php"
6. Defer loading of JavaScript
CONFIGURATION (DEFAULTS)
========================
$Configuration['Plugins']['PageSpeed']['DisableMinifyCss'] = False;
Disable compressing css code.
$Configuration['Plugins']['PageSpeed']['CDN']['jquery'] = '1.6';
$Configuration['Plugins']['PageSpeed']['CDN']['jqueryui'] = '1.8';
Loads desired version of jQuery and jQueryUI.$Configuration['Plugins']['PageSpeed']['CDN']['jqueryui-theme'] = 'smoothness';
jQueryUI theme name.$Configuration['Plugins']['PageSpeed']['AllInOne'] = 0;
Values:
1 - all css and javascript files combined into one file
2 - minify javascript only
0 (Default) - three groups (library, applications, plugins)
$Configuration['Plugins']['PageSpeed']['DeferJavaScript'] = 0;
Defer loading of JavaScript (JavaScript at bottom).
Values:
1 - just put tags at bottom
2 - dynamic loading, http://code.google.com/speed/page-speed/docs/payload.html#DeferLoadingJS$Configuration['Plugins']['PageSpeed']['ParallelizeEnabled'] = False;
Enables/disables parallelize downloads.
$Configuration['Plugins']['PageSpeed']['ParallelizeHosts'] = array('static1.example.com', 'static2.example.com', 'static3.example.com');
Parallelize downloads across this hosts.
$Configuration['Plugins']['PageSpeed']['JoinLocaleSources'] = False;
Allow join locale source files to one (server side optimization).
$Configuration['Plugins']['PageSpeed']['SetImageDimensions'] = False;
NOTE! REMOVED SINCE 1.60
If image attributes height and width not specified, this option enables post-processing
and set height/width for all images of entire html content.
$Configuration['Plugins']['PageSpeed']['MinifyCss'] = True;
Compress css code.
NOTE: REMOVED SINCE 1.86.
Replaced by $Configuration['Plugins']['PageSpeed']['DisableMinifyCss'] (inverted)POSSIBLE PROBLEMS
=================
1. If you installed vanilla into directory you may have problems with images in css.
Maybe other errors (No such file).2. Remote compression javascript code service can be down.
CHANGELOG
=========
1.91 (10 Aug 2012)
- fixed importing css url
- removed feature join locale sources1.90 (23 Dec 2011)
- checking mtime files in cache directory1.89 (20 Dec 2011)
- removed hardcoded Cdns in 2.1a61.88 (7 Dec 2011)
- fixed regexp in parallelize downloads (only images and scripts)1.87 (25 Nov 2011)
- handle multiple javascript onload1.86 (5 Nov 2011)
- allow turn off plugin
- new option "Disable compressing css code"
- allow join locale source files to one (server side optimization)1.80 (28 Oct 2011)
- GUI settings
- new way getting cached file (checking version, dont use filemtime() anymore)1.73 (13 Oct 2011)
- parallelize downloads1.72 (13 Oct 2011)
- various DeferJavaScript options1.70 (12 Oct 2011)
- new feature: DeferJavaScript1.60 (unknown date)
- removed AbsoluteSource()
- removed SetImageDimensions feature1.50 (7 Aug 2011)
- new config option AllInOne
- improvements of css processing1.40 (19 Jun 2011)
- set image dimensions
- loading jqueryui css theme from CDN
- themes group files moved to library group1.30 (19 May 2011)
- loading jqueryui from cdn