Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to think about reducing your download size first:</p> <ul> <li>putting all your js and css into as few files as possible. This is because a client can only open <strike>2 HTTP channels</strike> (most browsers now support more, info <a href="https://stackoverflow.com/a/14768266/542251">here</a>) at any one time, all file downloads after this are queued until the previous ones finish downloading.</li> <li><a href="http://code.google.com/p/minify/" rel="nofollow noreferrer">minify</a> your js and css.</li> </ul> <p>Once you've got this down to a reasonable size then you can think about the above. You want to download, the smallest amount of content upfront, so <strong>in the master</strong>. This will improve performance because then the client can cache it. Caching is a good thing, this stops the client having to request the js and css every time they visit a page on your site. </p> <p>You might also want to think about applying HTTP expiry headers.</p> <p>Yahoo do a good site on lots of these ideas: <a href="http://developer.yahoo.com/performance/rules.html" rel="nofollow noreferrer">http://developer.yahoo.com/performance/rules.html</a></p> <p><strong>Also</strong> don't put your js in the viewbag. This is unnecessary overhead and load on the server. Just add a reference in your pages!</p> <p>I've just come across this, which might do roughly what your after if you want to inject js and css but keep the caching functionality:</p> <p><a href="http://yepnopejs.com/" rel="nofollow noreferrer">http://yepnopejs.com/</a></p> <p>MVC4 now supports <a href="http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minificationn" rel="nofollow noreferrer">bundling</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload