3

I am planning a new website with several assets (js/css). I want to combine those assets to one js file and one css file. I am not sure if using server side technic, such as pagespeed (which has several more usages and does not require client side special actions), or using client side amd pattern with require.js (which gives me the ability to write modular javascript with dependencies, but requires some client side overhead , writing the amd patterns)

What would you prefer?

Barry Pitman
  • 3,087
  • 1
  • 24
  • 32
Yaniv Efraim
  • 6,633
  • 7
  • 53
  • 96
  • 1
    If you want to write modular, maintainable, client-side JS code, then RequireJS is a good fit. Using `r.js` to build your production JS should be good for performance, but ultimately you may have to test both approaches as only you know your exact performance requirements. – Paul Grime Jun 20 '13 at 08:30
  • 2
    MOD PAGESPEED is more like a plug and play module that can handle most of the basic optimisation tasks and does it quite well. One of the main feature of pagespeed that it tries to safely compress/combine only those files, that pass basic validation without using advanced tricks, leaving trouble some areas intact. – Nazariy Jun 20 '13 at 18:40

0 Answers0