Is it possible to use AWS Beanstalk's .ebextensions config to install mod_pagespeed Apache module?

前端 未结 4 535
执念已碎
执念已碎 2020-12-29 12:43

I\'m using AWS Beanstalk for my Django/Python application, and I would like to use Google\'s mod_pagespeed module. Is it possible to install and run mod_pagespeed using the

4条回答
  •  萌比男神i
    2020-12-29 13:29

    Ok so I want to add Charlie Smith's answer. I would suggest you make sure you have the following things turned on.

    1. mod_deflate - You probably want to Gzip your html, css, xml, and javascript.
    2. Enable the rewrite domains filter in your Apache.conf if you use CDN (ex. AWS CloudFront)
    3. Set a short cache-control for images and css so pagespeed will be able to extend the cache when you turn on the extend_cache filter.
    4. I also like the rewrite_javascript, dns_prefetch, collapse_whitespace, and combine_javascript filters.

    Here are the GitHub Gists that show you how its done.

    • The apache conf file
    • The Beanstalk container_commands (they are mostly the same as Charlie's)

提交回复
热议问题