Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
jeffkaufman edited this page Dec 21, 2012 · 12 revisions

Accurate as of 2012-12-21

Most of ngx_pagespeed is glue code, attaching PageSpeed to Nginx. What's attached to what, and how does it work?

The two main places we interact with an Nginx request are in a body filter and a content handler. In the body filter we pass html to PageSpeed for optimizing, while in the content handler we respond to requests for optimized PageSpeed resources (css, images, javascript). An example might be helpful.

  1. Nginx receives a request for http://example.com

     GET / HTTP/1.1
     Host: example.com
    
  2. Nginx calls our content handler, which declines to handle the request because it's not for an optimized .pagespeed. resource.

Clone this wiki locally