Git Product home page Git Product logo

ngx_pagespeed's Introduction

ngx_pagespeed

This is the nginx port of mod_pagespeed.

ngx_pagespeed is a work in progress, and is not yet functional. If you are interested in test-driving the module, or contributing to the project, please follow the instructions below. For feedback, questions, and to follow the progress of the project:


ngx_pagespeed speeds up your site and reduces page load time by automatically applying web performance best practices to pages, and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow. Features (will) include:

  • Image optimization: stripping meta-data, dynamic resizing, recompression
  • CSS & JavaScript minification, concatenation, inlining, and outlining
  • Small resource inlining
  • Deferring image and JavaScript loading
  • HTML rewriting
  • Cache lifetime extension
  • and more

How to build

nginx does not support dynamic loading of modules. You need to add ngx_pagespeed as a build time dependency, and to do that you have to first build the pagespeed optimization library.

First build mod_pagespeed, following these instructions: https://developers.google.com/speed/docs/mod_pagespeed/build_from_source

Then build the pagespeed optimization library:

$ cd /where/you/built/mod_pagespeed/src/net/instaweb/automatic
$ make all

Then move the mod_pagespeed directory to a parallel directory to your ngx_pagespeed checkout:

$ cd /path/to/ngx_pagespeed
$ mv /where/you/built/mod_pagespeed /path/to/mod_pagespeed

Now build nginx:

$ cd /path/to/nginx
$ auto/configure --add-module=/path/to/ngx_pagespeed
$ make install

While ngx_pagespeed doesn't need to be anywhere specific in relation to nginx, the mod_pagespeed directory and the ngx_pagespeed directory must have the same parent.

How to use

To your nginx.conf add to the main block or to a server or location block:

pagespeed on;

To confirm that the module is working, fetch a page and check that you see the following comment in the source:

<!-- Processed through ngx_pagespeed using PSOL version 0.10.0.0 -->

ngx_pagespeed's People

Contributors

jeffkaufman avatar bnoordhuis avatar igrigorik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.