像这样的动态网站有什么优势,而不是基于纯AJAX的网站? [英] Is there any advantage for dynamic website like this rather than pure-AJAX based ones?

查看:87
本文介绍了像这样的动态网站有什么优势,而不是基于纯AJAX的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将动态网站划分为两种类型:第一种使用PHP,并让PHP连接一个HTML页面,然后推回客户端;

>

第二个使用HTML模板,所有Web界面仅提供JSON数据,在加载HTML页面时动态提供所有字段。



前一类网站的优点是什么?什么是缓存?解析方案

基于PHP的网站更容易制作,更容易缓存,索引更好,但更少丰富。

基于Ajax的网站更加动态,如果做得好,感觉更快,因为您可能会异步收到许多小数据以更新需要更新的内容。当他们成长时,他们需要来自编码员的更多纪律和能力。让他们的关键是真正了解基础技术。



对于这些类别,我将添加服务器不在的案例(我使用的)像PHP这样的纯粹的被动技术,但支持后台线程和复杂的计算。你可以使用java或Go作为这些网站的例子。对于使用websockets将数据从服务器推送到客户端的基于Ajax的站点来说,它更加方便。

与LAMP相反,Ajax应用程序不会有一种风格需要实现。您必须根据您的确切需求选择您的工具(例如缩小,存储等),在客户端,基于Ajax的网站可以使用原始技术(html + js)制作,我个人不会不喜欢使用大型框架,但是您会发现jquery有助于使代码更清晰。


I divide dynamic websites into two types:

The first one use e.g PHP , and let PHP concatenate a HTML page , and push back to clients;

And the second one use a HTML template , and all web interfaces provides JSON data only , feed all fields dynamically when HTML page is loaded.

What's the advantage of the former type of websites ? And what about caching ?

解决方案

PHP based sites are easier to make, easier to cache, and better indexed, but much less rich.

Ajax based sites are more dynamic, feel faster if well made as you may receive many small data asynchronously to update what needs to be updated. When they grow, they require more discipline and competence from the coders. The key to make them is really understand the base technologies.

To those categories, I'll add the cases (the ones I use) where the server isn't in a pure passive technology like PHP but support background threads and complex computation. You can use java or Go for example for those sites. It's even more convenient for ajax based sites using websockets to push data from the server to the client.

Contrary to LAMP, Ajax applications don't come in one flavor you just have to implement. You have to choose your tools according to your precise needs (for example for minification, storages, and so on), On the client side, Ajax based sites can be made with "raw" technologies (html+js), I personnaly don't like to use big frameworks, but you'll find that jquery helps make the code cleaner.

这篇关于像这样的动态网站有什么优势,而不是基于纯AJAX的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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