20
I am trying to make development easy and have highly optimized output in production.
The goals of what I am trying to do is:
- Make production pages fast! I would like that the Google Page Speed and YSlow return the best scores. This means:
- Combine and compress JS files and CSS and position the group in the right place (bottom or top of the page) in the HTML. For .js Google Closure seems the best choice.
- .JS and .CSS are smartly cached but be sure that they get reloaded when of the .JS or CSS componet is updated. 301 File not changed etc.
- Cache type: I think cache on disk is fine. Consider APC and Memcache or Redis if they significantly improve speed.
- Capable to specify and use lazy load of .JS when necessary or at least not to block the page rendering.
- (Optional) Compress the HTML too.
- Make website development easy:
- Use short command in the .php file when you want to include .js or .css and compress them only in the production environment
- Use syntax like pack_js(['first.js', 'second.js' 'third.js']) and pack_css(['first.less', 'second.less' 'third.css'], true)
- It is easy to configure develpment or production environment. Maybe just a call to SetDebug(true or false). Default production
- Easy to set up cache folders and source folders
- Use of LESS to make CSS development sucks less. Automatically compile LESS files in CSS in production but use of LESS.js in development so that each time you change the .less file in development it is updated on the server.
- (optional) In
- Use short command in the .php file when you want to include .js or .css and compress them only in the production environment