网站开发注意事项下篇

来源:互联网 发布:ubuntu tomcat 配置 编辑:程序博客网 时间:2024/06/04 18:35

原文名:What technical details should a programmer of a web application
consider before making the site public?
原文地址:https://softwareengineering.stackexchange.com/questions/46716/what-technical-details-should-a-programmer-of-a-web-application-consider-before#

SEO (Search Engine Optimization)搜索引擎优化

1.Use “search engine friendly” URLs, i.e. use
example.com/pages/45-article-title instead of
example.com/index.php?page=45

意译:使用”搜索引擎友好”的URL形式,比如example.com/pages/45-article-title,而不是example.com/index.php?page=45。

2.Don’t use links that say “click here”. You’re wasting an SEO
opportunity and it makes things harder for people with screen
readers.

意译:不要使用”点击这里”之类的超级链接,因为这样等于浪费了一个SEO机会,而且降低了”屏幕朗读器”(screen
reader)的使用效果。

3.Use Google Webmaster Tools and Bing Webmaster Tools.

意译:使用Google的Webmaster Tools和Yahoo的Site Explorer。

4.Install Google Analytics right at the start (or an open source analysis
tool like Piwik).
意译:从一开始就使用Google Analytics(或者开源的访问量分析工具Piwik)。
5.Know how robots.txt and search engine spiders work.

意译:知道robots.txt的作用,以及搜索引擎蜘蛛的工作原理。

6.Redirect requests (using 301 Moved Permanently) asking for www.example.com to example.com (or the other way round) to prevent splitting the google ranking between both sites.
意译:将www.example.com的访问请求导向example.com(使用301 Moved Permanently重定向),或者采用相反的做法,目的是防止Google把它们当做两个网站,分开计算排名。
7.Know that there can be badly-behaved spiders out there.

意译:知道存在着恶意或行为不正当的网络蜘蛛。

8.If you have non-text content look into Google’s sitemap extensions for video etc.

意译:如果你的网站有非文本的内容(比如视频、音频等等),你应该参考Google的sitemap扩展协议。

9.There is some good information about this in Tim Farley’s answer.


Technology(技术)

1.Understand HTTP and things like GET, POST, sessions, cookies, and
what it means to be “stateless”.

意译:理解HTTP协议,以及诸如GET、POST、sessions、cookies之类的概念,包括”无状态”(stateless)是什么意思。

2.Write your XHTML/HTML and CSS according to the W3C specifications and
make sure they validate. The goal here is to avoid browser quirks
modes and as a bonus make it much easier to work with non-traditional
browsers like screen readers and mobile devices.

意译:确保你的XHTML/HTML和CSS符合W3C标准,使得它们能够通过检验。这可以使你的网页避免触发浏览器的古怪行为(quirk),而且使它在”屏幕朗读器”和手机上也能正常工作

3.Understand how JavaScript is processed in the browser.

意译:理解浏览器如何处理JavaScript脚本。

4.Understand how JavaScript, style sheets, and other resources used by
your page are loaded and consider their impact on perceived
performance. It is now widely regarded as appropriate to move scripts
to the bottom of your pages with exceptions typically being things
like analytics apps or HTML5 shims.

意译:理解网页上的JavaScript文件、样式表文件和其他资源是如何装载及运行的,考虑它们对页面性能有何影响。在某些情况下,可能应该将脚本文件放置在网页的尾部。

5.Understand how the JavaScript sandbox works, especially if you intend
to use iframes.

意译:理解JavaScript沙箱(Javascript sandbox)的工作原理,尤其是如果你打算使用iframe。

6.Be aware that JavaScript can and will be disabled, and that AJAX is
therefore an extension, not a baseline. Even if most normal users
leave it on now, remember that NoScript is becoming more popular,
mobile devices may not work as expected, and Google won’t run most of
your JavaScript when indexing the site.

意译:知道JavaScript可能无法使用或被禁用,以及Ajax并不是一定会运行。记住,”不允许脚本运行”(NoScript)正在某些用户中变得流行,手机浏览器对脚本的支持千差万别,而Google索引网页时不运行大部分的脚本文件。

7.Learn the difference between 301 and 302 redirects (this is also an
SEO issue).
意译:了解301重定向和302重定向之间的区别(这也是一个SEO相关问题)。
8.Learn as much as you possibly can about your deployment platform.

意译:尽可能多得了解你的部署平台(deployment platform)。

9.Consider using a Reset Style Sheet or normalize.css.

意译:考虑使用样式表重置(Reset Style Sheet)。

10.Consider JavaScript frameworks (such as jQuery, MooTools, Prototype,
Dojo or YUI 3), which will hide a lot of the browser differences when
using JavaScript for DOM manipulation.

意译:考虑使用JavaScript框架(比如jQuery、MooTools、Prototype),它们可以使你不用考虑浏览器之间的差异。

11.Don’t reinvent the wheel. Before doing ANYTHING search for a
component or example on how to do it. There is a 99% chance that
someone has done it and released an OSS version of the code.

意译:不要重复造轮子。在做一个事情前,可以使用搜索怎么去实现一个组件或者例子。也有有99%的机会已经有完成并发布了一个OSS版本的代码。

12.Particularly on the client-side web where it’s almost always ultimately more important to keep things lightweight, fast, and flexible.

意译:在客户端网络上,保持轻量级,快速和灵活的方式几乎总是更重要。


Bug fixing(解决)

1.Understand you’ll spend 20% of your time coding and 80% of it
maintaining, so code accordingly.

意译:理解程序员20%的时间用于编码,80%的时间用于维护,根据这一点相应安排时间。

2.Set up a good error reporting solution.

意译:建立一个有效的错误报告机制。

3.Have a system for people to contact you with suggestions and
criticisms.

意译:建立某些途径或系统,让用户可以与你接触,向你提出建议和批评。

4.Document how the application works for future support staff and
people performing maintenance.

意译:为将来的维护和客服人员撰写文档,解释清楚系统是怎么运行的。

5.Make frequent backups! (And make sure those backups are functional)
Have a restore strategy, not just a backup strategy.

意译:经常备份!(并且确保这些备份是有效的。)除了备份机制,你还必须有一个恢复机制

6.Use a version control system to store your files, such as Subversion,
Mercurial or Git.

意译:使用某种版本控制系统储存你的文件,比如Subversion或Git。

7.Don’t forget to do your Acceptance Testing. Frameworks like Selenium
can help.Especially if you fully automate your testing, perhaps by
using a Continuous Integration tool, such as Jenkins.

意译:不要忘记做单元测试(Unit Testing),Selenium之类的框架会对你有用。

原创粉丝点击