文件结构的最佳方法? [英] best approach for file structure?

查看:91
本文介绍了文件结构的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是更好/更快?
我们需要一个简短而快速的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.

这篇关于文件结构的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆