server酱
I like minimalist websites. I understand teaser pages with attitude, especially for stars like Eminem. But the source code of the current landing page drives me to dismay.
我喜欢简约的网站。 我了解态度的预告片,尤其是对于像Eminem这样的明星。 但是当前登录页面的源代码使我感到沮丧。
What do we have here?
我们有什么在这里?
- Over 900 lines of code 超过900行代码
- 66 separate HTTP requests for resources that are entirely unused 66个单独的HTTP请求,这些请求完全没有使用
- A 200k image 200k图像
- Total 779KB download 总计779KB下载
What should it be?
应该是什么
This:
这个:
html { height: 100%; }
body {
background: url('eminemflippingeveryoneoff.jpg') black no-repeat center;
margin: 0;
background-size: cover;
}
That’s the entire page. That’s ultra-minimalism.
这就是整个页面。 那是极简主义。
The image can be optimized to 15KB. Add in a link to Google Analytics and you’re done. Total page size: 16KB.
图像可以优化到15KB。 添加指向Google Analytics(分析)的链接,即可完成。 页面总大小:16KB。
Why this monstrosity instead? Partly because the developers chose to make it with Drupal Gardens, a CMS that adds a ton of cruft to the code. Server-side caching will deliver the page as fast as it can, but there’s no need to use a CMS for a teaser site. Just throw up a static page and you’re done.
为什么是这种怪物? 部分原因是开发人员选择使用Drupal Gardens来实现, Drupal Gardens是一种CMS ,它在代码中增加了很多内容。 服务器端缓存将以最快的速度交付页面, 但是无需对预告站点使用CMS 。 只需抛出一个静态页面即可。
As it exists, the landing page is a giant middle finger to fan’s bandwidth, especially given that many of them will be using mobile devices to check out the site: they’re downloading a page that is literally 50 times larger than it should be.
确实存在,登陆页面是风扇带宽的巨大中指,尤其是考虑到许多人将使用移动设备来检出站点:他们正在下载的页面实际上比实际大小大50倍。
server酱