best approach for file structure?

…衆ロ難τιáo~ 提交于 2019-12-12 00:15:26

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/10976430/best-approach-for-file-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!