Re: Best Cloudfront CDN settings for mod-pagespeed

784 views
Skip to first unread message

Andrew Mattie

unread,
Jul 18, 2012, 1:00:00 PM7/18/12
to mod-pagesp...@googlegroups.com
We use CloudFront for our platform and haven't changed any origin params at all. mod_pagespeed sets the expiration header itself and so CloudFront will happily just pass that along to your users.

The default minimum TTL on the edge servers is 3600 seconds, should I bring that down to 600 seconds similar to the recommended apache settings?

The min TTL is only useful when the TTL falls below that threshold. Since MPS sets it so high anyway, the min TTL shouldn't affect too much. The only situation where it does affect things on a MPS-enabled server that I've noticed is within rewritten URLs within unprocessed, CDN-hosted CSS. Take a look at this URL for example: http://cdn1.app.zp-cdn.com/wooden_theme/wp-content/themes/wooden/style.css,qver=3.3.3.pagespeed.ce.sETzU7ZKeZ.css. Notice how the fonts and images aren't cache-extended? We added within Apache a default 2h max cache age to non-cache-extended resources for that reason. We could have changed that within CloudFront I suppose, but I find it easier to keep track of everything by putting it in the Apache config instead.

I assume it's good to use the origin cache headers?

Other than the issue I described above, we generally haven't specified any other origin cache headers.

Andrew

On Tue, Jul 17, 2012 at 10:12 AM, marstonstudio <marsto...@gmail.com> wrote:
Hello,

I'm setting up an Amazon Cloudfront CDN distribution to use for delivering static assets on my site. My origin will point to a mod-pagespeed enabled apache server with extended-cache operating, so the max-age header for the renamed css,js,jpg,etc assets should be high and the original source assets should be low max-age.

Does anybody have recommendations on the best settings to use for the cloudfront origin parameters in conjunction with mod-pagespeed?
interesting documentation here: 

- The default minimum TTL on the edge servers is 3600 seconds, should I bring that down to 600 seconds similar to the recommended apache settings?
- Is it worth specifying different behavior for different path patterns for these values or just set a single TTL/Cache behavior for the site?
- I assume it's good to use the origin cache headers?

My plan is to stick with the cloudfront defaults, but I'm curious if there are better values or approaches when using mod-pagespeed with a cdn. Guidance from people who have been down this road before greatly appreciated.

Jon Marston
EnglsihCentral


A Boston

unread,
Jul 18, 2012, 12:38:49 AM7/18/12
to mod-pagesp...@googlegroups.com
there is no hard rule, otherwise sys admins would be replaced with
more cron jobs.

consider a site change.

css and js may have the same identifier (default.css, main.css). so
keep it 1 day during your pre-site change days, then make it a week.

one usually changes the entire identifier of a jpg, png etc. the
graphic is usually substituted entirely (myfirstgraphic.png,
mysecondgraphic.png) so there is no conflict. a really long time 1
year 60*24*356 is possibly fine.
Reply all
Reply to author
Forward
0 new messages