Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mod_pagespeed and Rails - does it improve anything?

Rails 2.3.*, mod_passenger 2.2.* and Apache 2.2.*. Is it worth installing mod_pagespeed or does Rails create all cache headers, etc. properly so that mod_pagespeed is unnecessary?

like image 313
Paweł Gościcki Avatar asked Nov 05 '10 11:11

Paweł Gościcki


1 Answers

mod_pagespeed applies several performance optimizations and filters. Rails already includes some of these best practices, such as asset packaging but mod_pagespeed goes even further by compressing and minifying each asset package.

Many of the mod_pagespeed filters can be performed using Ruby by creating specific Rails features or filters, but if you never applied any performance optimization to Ruby until today, the mod_pagespeed is a good plug&play tool.

mod_pagespeed works at server level. It means that several optimization are a little bit more efficient than running the same optimization at Rails level.

Whether you will use mod_pagespeed or not, take the time to inspect your Rails application and ask yourself if you don't have other sections of your application that deserve optimization. The performance improvements provided by mod_pagespeed don't definitely solve all your performance problems.

I saw programmers trying to use asset caching to gain 3ms while they didn't implement any memcached caching strategy to reduce computation time in their Rails model methods. In other words, mod_pagespeed should not be a plug&forget add-on, but just one step in your optimization strategy.

like image 198
Simone Carletti Avatar answered Nov 12 '22 14:11

Simone Carletti