Meetup Presentation June 2012

Here’s the slides (pdf) from the presentation last night. I’ve pulled out a couple of the more useful code sections below. Any questions, or if you want any links not in the slides, let me know in the comments.

The first line rewrites static resources via a custom origin CDN, the second shards those resources between 2 or more CDN hostnames. We have a CloudFront distribution setup on cdn1|2.dmn.tld that uses domain.tld as the origin. No other config required.

ModPagespeedMapRewriteDomain static.dmn.tld domain.tld
ModPagespeedShardDomain static.dmn.tld cdn1.dmn.tld,cdn2.dmn.tld

We use these mod_pagespeed filters:
combine_javascript,remove_comments,collapse_whitespace,outline_javascript

I’d recommend using the ModPagespeedLoadFromFile directive:

ModPagespeedLoadFromFile "http://static.dmn.tld/js/" "/var/www/path/to/htdocs/js/"
ModPagespeedLoadFromFile "http://static.dmn.tld/skin/" "/var/www/path/to/htdocs/skin/"
ModPagespeedLoadFromFile "http://static.dmn.tld/media/" "/var/www/path/to/htdocs/media/"

Few links for the truly lazy who don’t want to search!

Advertisements

One thought on “Meetup Presentation June 2012”

  1. Hi,

    Thanks for the writeup. Im having issues with trying to test out pagespeed using multipl cdn’s via cloudfront. Mainly It loads the page the first time, however on subsequent page reloads just 404’s out.

    Looking into the server, it builds a local cache of the images/css, but I think in next reload, cannot write the cach directory on the server. Can you possibly assist in setup?

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s