best approach for file structure?

2019-08-31 03:41发布

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?

2条回答
成全新的幸福
2楼-- · 2019-08-31 04:11

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.

查看更多
女痞
3楼-- · 2019-08-31 04:33

The folder names make no difference. You should focus on actually optimizing your files and how they are delivered.

Once you have optimized your files, consider looking into a content delivery networking like www.cloudflare.com if you are worried about speed.

查看更多
登录 后发表回答