Actions

Help

Difference between revisions of "Modules:PageSpeed"

From OpenLiteSpeed Wiki

(Add PSOL)
Line 15: Line 15:
 
The PageSpeed Optimization Libraries (PSOL) are a set of C++ classes that automatically optimize web pages.  
 
The PageSpeed Optimization Libraries (PSOL) are a set of C++ classes that automatically optimize web pages.  
  
Go into the PageSpeed Module's directory (<code>/openlitespeed_download/src/modules/pagespeed</code>) and run <code>./ccc.sh</code> to get the latest version of PSOL supported by OpenLiteSpeed. Do not use other versions of PSOL as they may not be supported by OpenLiteSpeed. (The current version of PSOL supported by OpenLiteSpeed is listed in our [[Release_Log]].)
+
Go into the PageSpeed Module's directory (<code>/openlitespeed_download/src/modules/pagespeed</code>) and run <code>./ccc.sh</code> to get the latest version of PSOL supported by OpenLiteSpeed. Do not use other versions of PSOL as they may not be supported by OpenLiteSpeed. (The current version of PSOL supported by OpenLiteSpeed is listed in our [[Release_Log/1.x|release log]].)
  
 
<pre>cd /openlitespeed_download/src/modules/pagespeed
 
<pre>cd /openlitespeed_download/src/modules/pagespeed

Revision as of 21:23, 22 December 2014

This wiki discusses how to add and configure OpenLiteSpeed's PageSpeed module. The PageSpeed module allows OpenLiteSpeed to support Google's PageSpeed optimization system.

For this guide, we assume you already have a working installation of OpenLiteSpeed 1.4.2 or higher. Module support is available in versions 1.3 or higher, but the PageSpeed module is only available and supported starting with version 1.4.2. The PageSpeed module is not added to OpenLiteSpeed installations automatically and so must be built.

Note: PageSpeed Optimization Libraries (PSOL) are only available for Linux and thus OpenLiteSpeed's PageSpeed Module is only available for Linux.

Building the LiteSpeed PageSpeed module

Download and install OpenLiteSpeed 1.4.2 or higher if you have not done so

The PageSpeed Module is available starting with OpenLiteSpeed version 1.4.2.

Add PSOL

The PageSpeed Optimization Libraries (PSOL) are a set of C++ classes that automatically optimize web pages.

Go into the PageSpeed Module's directory (/openlitespeed_download/src/modules/pagespeed) and run ./ccc.sh to get the latest version of PSOL supported by OpenLiteSpeed. Do not use other versions of PSOL as they may not be supported by OpenLiteSpeed. (The current version of PSOL supported by OpenLiteSpeed is listed in our release log.)

cd /openlitespeed_download/src/modules/pagespeed
./ccc.sh

Build modpagespeed.so

make

Note: If compiling does not work, try gmake instead of make.

Move the dynamic library to your modules directory

cp modpagespeed.so /usr/local/lsws/modules

Setting up the module

Add the PageSpeed Module by going to WebAdmin console > Configuration > Server > Modules > Add

PageSpeed Mod Add.png

Enter the name of the module as "modpagespeed"

PageSpeed Mod Name.png

Set parameters

PageSpeed Mod Param.png

PageSpeed may be configured using a variety of settings and filters. The following are some default parameters:

pagespeed on
pagespeed FileCachePath /tmp/lshttpd/pagespeed
pagespeed RewriteLevel CoreFilters

Configuration is covered in more detail in the configuration section.

Save the module settings

PageSpeed Mod Save.png

Restart the server

Configuration

Configuration of OpenLiteSpeed's PageSpeed Module follows the syntax outlined in Google's documentation for the NGINX module. The one difference is that lines should not end with a semicolon (;).

Important Parameters

  • pagespeed on/off = This parameter turns PageSpeed on or off at the server or virtual host level.
  • pagespeed FileCachePath = Determines the location of the PageSpeed cache. (If this directory does not exist, OpenLiteSpeed will create it.)
  • pagespeed RewriteLevel CoreFilters = CoreFilters is a set of filters that the Google PageSpeed team believes are safe for most websites. The CoreFilters set is dynamically updated.

Further configure the module at the virtual host level

The PageSpeed Module can be further configured at the virtual host level. (Google does not support context- and script handler-level configurations.) Virtual host-level configurations will always override server level-configurations.

Note: Always leave the Enable Hooks setting as "Not Set". Setting it to "No" will not disable PageSpeed at the virtual host level and may cause unpredictable functionality. To disable PageSpeed at the virtual host level, use pagespeed off in the virtual host-level module parameters.

Note

Do not use with the PageSpeed Module with OpenLiteSpeed's Cache Module. PageSpeed has its own cache and using the two modules together may cause unpredictable functionality.