真的有可能达到“A”级吗?在雅虎的 yslow 中,动态/CMS 网站的所有内容都可以吗?

发布于 2024-08-24 09:06:58 字数 593 浏览 4 评论 0原文

对于基于动态和 CMS(PHP/Asp.net) 的网站,真的有可能在 yslow 中获得“A”级吗?并使用同一服务器。

替代文本
(来源:haacked.com )

http://developer.yahoo.com /yslow/help/index.html#performance_view

Is it really possible to achieve grade "A" in yslow for all things for a dynamic and CMS(PHP/Asp.net) based websites? and using same server.

alt text
(source: haacked.com)

http://developer.yahoo.com/yslow/help/index.html#performance_view

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

温柔戏命师 2024-08-31 09:06:58

是的,我想可以在一台服务器上实现这一点,当然 CDN 除外依赖于外部服务的部分。您可能需要完全控制您的服务器来配置 ETag 等内容。

我认为,很少值得付出努力来实现所有这些字面意义上的最后一个百分比,除非您是像 Google 或 Yahoo 这样的大型网站,其中每个保存的字节都可能意味着数万或数十万的节省。只要获得适当的成绩,一切就可以快速可靠地进行 - 就像在学校一样:)

Yes, I guess it is possible to achieve this on one server, except of course for the CDN part which relies on an external service. You'll probably need full control over your server to configure things like ETags and such.

I think it's rarely worth the effort to fulfill all this literally down to the last percent except if you're a huge site like Google or Yahoo themselves, where every saved byte can mean tens or hundreds of thousands in savings. Just get a proper grade so things work fast and reliably - much like in school :)

离线来电— 2024-08-31 09:06:58

是的。首先,尝试将所有 JS 外部化,并按需加载,仅预加载您真正需要的组件。然后按顺序监视​​每个 javascript 文件何时加载。通过 JSBuilder(JavaScript 打包和压缩工具)运行它。

在您的服务器上打开 GZIP。 Gzip 压缩能够将我的静态文件大小(css、js 等)减少 73.43%。

缓存,缓存,缓存。任何在应用程序部署之间不变的内容都需要有一个远期过期标头。

如果您负担得起,请通过 CDN 提供文件。它们是分布式网络,可以更轻松地交付内容。

摆脱您的 cookie,或者通过将它们的值编码为 JSON 或使用服务器端缓存服务来缓存值来组合它们,并且仅将缓存键存储在 cookie 中。这样你就只有一块饼干而不是数百块。

将 css 放在顶部,并通过删除任何未使用的选择器和属性来优化它。

哦,考虑切换到瘦客户端...重新加载网页已经是 1999 年的事情了。使用瘦客户端允许您尝试不同的页面下载优化技术,并将您的视图(Web 客户端)与服务器和中间件 api 解耦,允许您在您选择的几乎任何 RIA 环境中开发前端。您可以使用极其轻量级的 JQuery,或者使用 Ext 或 Dojo 的更强大的预构建 UI。

减少未使用的 HTML 数量。除非绝对必要或在页面加载后插入到 dom 中,否则表是邪恶的。

我确信其中一些需要进行一些重大的返工,而您的应用程序架构和开发人员技能目前可能不适合。好消息是,您只需在服务器端缓存 cookie(就像我上面提到的那样)、压缩静态组件、组合和缩小所有 JS、优化 CSS 和布局即可改善用户体验,而无需深入了解重新构建您的 Web 应用程序。

Yes. First of all, try making any and all of your JS external, and load it on demand, only preloading the components that you really need. Then monitor when each javascript file is loaded, in order. Run that through JSBuilder (JavaScript packaging and compressor tool).

Turn on GZIP on your server. Gzip compression was able to reduce my static filesizes (css, js, etc.) by 73.43%.

Cache, cache, cache. Anything that doesn't change between application deployments needs to have a far-future expires header.

If you can afford it, serve your files from a cdn. They are distributed networks that make delivering content easier.

Get rid of your cookies, or combine them by encoding their values in JSON or using a caching service server-side to cache the values, and only store the cache key in the cookie. That way you only have one cookie instead of hundreds.

Put your css at the top, and optimize it by stripping out any unused selectors and properties.

Oh, and consider switching to a thin client...reloading the web page is so 1999. Using a thin client allows you to try different page download optimization techniques, and decouples your view (the web client) from your server and middleware api, allowing you to develop a front end in just about any RIA environment of your choice. You can go extremely lightweight with JQuery, or go with the more robust pre-built UI's of Ext or Dojo.

Reduce the amount of unused HTML. Tables are evil unless absolutey necessary or inserted into the dom after page load.

I'm sure that some of this will require some major re-work, which your application architecture and developer skill set may not be geared for at this time. The good news is that you can improve your user-experience just by cacheing cookies server-side (like I mentioned above), gzipping your static components, and combining and minifying any and all JS, and optimizing your CSS and layout, without getting into re-structuring your web application.

尤怨 2024-08-31 09:06:58

当然可以,为什么不呢?

每个项目后面都有一个链接,其中包含有关如何获得更高分数的更多详细信息

Sure, why not?

Each item follows through to a link with more details on how to acheive a higher grade

清浅ˋ旧时光 2024-08-31 09:06:58

是的,这是可能的。

以下是Typo3 安装优化的成功指导示例。看看 这个 Yahoo!页面以获得优化的好处。

是否值得尝试优化带宽减少和服务器响应能力?当然!
许多人通过手持设备与昂贵的手机套餐进行连接。我居住的学校系统甚至有有限且昂贵的宽带计划。等待网站加载是浪费时间。

Yes, it is possible.

Here is a guided success example of an optimisation of a Typo3 installation. Take a look at this Yahoo! page for optimisation goodies.

Is it worth trying to optimise for bandwidth reduction and server responsiveness? Sure!
A lot of people connect through hand-held devices with expensive mobile phone plans. The school system where I live even have limited and expensive broadband plans. Waiting for a website to load is a waste of time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文