Allove Team 致力于移动应用的开发和服务(Android,J2ME,iphone,ophone)
« 欢迎使用手机访问我们的wap技术博客 Kevin Mitnick 最黑的黑客 »
2009年04月17日[技术分享]C/C++

916位读者

CGI, FASTCGI, XML, XSLT

CGI? 太老了吧!是的,一般人都会说是过时的技术。而且它的并发性很低,很难应付高并发的请求。主要是每次请求服务器都要启动进程,然后处理。而其实CGI程序本身运行的时间很少,尤其是用C开发的CGI,其速度是不用怀疑的。要解决服务器启动进程耗时的问题,利用FASTCGI就可以了。它在CGI的基础上,提供了很好的缓存机制,每次请求不需要建立进程,传说其速度可以达到shtml的水平,差不多是纯静态html的一半。也传说百度、Google也是用C/C++写的,虽然不知道它们具体是怎么做的,但是绝对是离不开C的。

然而,不管是CGI还是FASTCGI,还有个问题就是必须一条一条的输出html,不像php、asp那样直接可以在html中嵌入脚本。解决这个问题,就使用到了XML和XSLT。利用CGI/FASTCGI的高速度来处理数据(XML格式),不涉及显示层,也就是不用手动输出html标签,只要处理XML数据就行了,而处理XML数据还是比较简单的。显示的工作交给XSLT,而且现在大部分的浏览器都支持XSLT,也就是不用在服务器端执行XML的转换工作,直接把数据发送到浏览器,让浏览器转换、显示,这样还可以缓解服务器的压力。而且XSLT还可以执行一些逻辑,比如排序,这样可以把更多的工作分配给浏览器端。

这就是CGI/FASTCGI 与XML、XSLT结合的优势。

随机日志

日志信息 »

该日志于2009-04-17 13:39由 joiman 发表在[技术分享]C/C++分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

7条评论

  1. 林晨 说:

    只知道XML,其他都不懂

    回复

    joiman Reply:

    @林晨, 这学期有XML的课,XML相关的基本都讲到了。心血来潮就用那些东西做了个Blog,地址http://joiman.com/,有兴趣可以看一下哦(现在功能还很少)

    回复

  2. qintao 说:

    牛!用C 写 的网站 哈哈 暴强!长见识了

    回复

  3. haussyEthetry 说:

    All good health!
    Throughout its 27-year history, the Alzheimer’s Association leadership, support Buy online COMBIPRES. Prices reduced by 15% and education of individuals with Alzheimer’s and nursing staff are and 2007 Buy Zyban Here!!! Lowest prisece!!!High quality product!!! is no exception. 26-29 August 2007, the association held its 15th annual meeting of dementia care Buy online Phentrimine. Prices reduced by 15% , health care professionals the opportunity to connect with their peers Prices reduced by 15% Buy online Viagra Super Active throughout the country, learning the old well-known experts and educational courses tailored to their unique needs . During the meeting, the association issued a dementia care practice recommendations Buy Сombipres Here!!! Lowest prisece!!!High quality product!!! apartment assisted living and nursing homes: Phase 3, the ultimate care, third in a series of recommendations. These recent proposals focus on Buy Lioresal Here!!! Lowest prisece!!!High quality product!!! improving end-of-life experience in Alzheimer’s disease and other forms of dementia has provided specific recommendations to address the problems for this population. The results of these recommendations in cooperation between the staff association, representing more than 30 national associations and other experts.
    We will be glad to see you

    回复

  4. haussyEthetry 说:

    Hi
    Throughout its 27-year history, the Alzheimer’s Association leadership, support Buy online Viagra Soft Tabs and education of individuals with Alzheimer’s and nursing staff are and 2007 Buy online WELLBUTRIN is no exception. 26-29 August 2007, the association held its 15th annual meeting of dementia care Buy Female viagra Here!!! We have more than 100 customers in a minute!!! High quality product!!! , health care professionals the opportunity to connect with their peers Prices reduced by 15%! Buy Online Skelaxin (Metaxalone) throughout the country, learning the old well-known experts and educational courses tailored to their unique needs . During the meeting, the association issued a dementia care practice recommendations Buy Сombipres Here!!! Lowest prisece!!!High quality product!!! apartment assisted living and nursing homes: Phase 3, the ultimate care, third in a series of recommendations. These recent proposals focus on Paxil (Paroxetine). Prices reduced by 15% improving end-of-life experience in Alzheimer’s disease and other forms of dementia has provided specific recommendations to address the problems for this population. The results of these recommendations in cooperation between the staff association, representing more than 30 national associations and other experts.
    We will be glad to see you

    回复

发表评论 »

返回顶部