2011年2月11日星期五

Re: [fw-mvc] Re: CSS/JS Includes

On 2/11/11 3:57 AM, Joe Balancio wrote:
> Yes, you can include all the styles your site will need in one CSS, but you
> get the overhead of including styles that some pages will not need. Same
> thing with JS.
>
> So, if I'm creating a complex site with many pages with many styles, I need
> a way to manage all of that.
>
> -----
> - Joe
You can try the 80/20 approach. I tend to gather most of the common css
/ js into single files included on every page. (minified when we do a
production build)
Then, for the specialty stuff, try something like this:
http://devzone.zend.com/article/11760
You can even extend that concept to produce a css / js file per
controller, or per module.
With some experimentation, I am sure you can find a comfortable balance
between managing lots of files, and only making a few cache-able requests.

-Matt

没有评论: