Search code examples
performancefile-structure

best approach for file structure?


What is better / faster?
We need a short and fast file structure for a javascript / ajax web app

rs -> c (for css files)
rs -> j (for js files)
rs -> i (for images)

or:

-> stylesheets
-> scripts
-> images

or:

-> css
-> js
-> img

does it make any difference if the urls are shorter?


Solution

  • If you're concerned about two or three bytes in your source code per resource (pre-compression). Then either your website is already highly optimised or you're looking in the wrong place for performance gains.

    I'd be more concerned with how your content delivery is spread across things like subdomains/CDNs to maximise load throughput.

    Ensure everything is cacheable, also things like ensuring your script includes are bunched up if you can and includes in your CSS.