Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One strategy for having 1 CSS and 1 JS file is to have a manifest file per model. So say for example you have User and a Widget model; the user dashboard lies within the User controller, and the product page is within the Widget controller. You can collect only the styles and javascripts needed for widgets into a concatenated file, and separately do the same thing for the user dashboard.

The upside is you've combined only the resources you truly need, though the downside is you bust the cache more often because you have twice as many manifests to download the separated content. Could be useful if you have a massive project and breaking it out will make for a significantly smaller download size.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: