什么是更好/更快? 我们需要一个简短而快速的javascript/ajax网络应用程序文件结构
rs-> c(用于CSS文件) rs-> j(用于js文件) rs-> i(用于图像)
或:
->样式表 ->脚本 ->图片
或:
-> css -> js -> img
如果网址较短,会有所不同吗?
解决方案如果您担心每个资源的源代码中有两个或三个字节(预压缩).然后,要么您的网站已经高度优化,要么您在寻找错误的地方来提高性能.
我将更加关注您的内容交付如何在子域/CDN之类的东西之间分散,以最大程度地提高负载吞吐量.
确保所有内容都是可缓存的,如果可以的话,请确保将脚本包括在内的内容也进行了整理.
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?
解决方案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.
更多推荐
文件结构的最佳方法?
发布评论