摘要
针对网站群系统静态化经常出现各种疑难问题的现状,提出了一种新的全站静态化方法。首先,采用内容管理系统(CMS)的模板技术开发了网站群系统的信息发布部分,采用Ajax技术开发了动态交互部分。其次,采用一个精心设计的静态化方案完成了全站静态化,涵盖了所有通用的和特殊定制的信息发布功能。再者,对于经常变更且计算复杂的局部页面数据采用数据库快照技术静态化并通过JSON传递,而快照采用一定的策略加以更新。然后,对于因某种原因导致的少数静态页未及时更新或缺失的情况,采用策略表进行管理,根据表中设置的规则决定每个页面是访问静态页还是动态页。最后,对于因静态化同时执行导致的内容分发网络(CDN)服务器偶尔缓存失败、用户访问不到静态页的情况,采用队列化静态化任务来从原理上避免,并辅以用户首次访问失败即自动触发同步的恢复机制作为保障。通过一个具体网站的静态化任务验证了此方法,以30个左右的页面模板为基础,对20 000个左右的页面进行全站静态化和增量静态化,没有出现任何差错,用户能及时访问到正确的静态页。这套方案的特点在于对静态化的常见情况作了分类,对每一类情况都作了针对性的处理,并且易于扩展,实践表明能显著提高网站群系统的访问速度、可靠性和安全性。
In view of all kinds of difficult problems in website group system staticization, a new full website staticization method was proposed. Firstly, the information publishing part of website group system was developed using the Content Management System( CMS) template technology, and the dynamic interaction part of website group system was developed using Ajax technology. Secondly, a well designed staticization solution was used to complete the full website staticization,covering all generally and specially customized information publishing functions. Thirdly, the database snapshot technology with update strategy was used to change and calculate the complex local page data, and the data was delivered through JSON.Fourthly, the policy table was used to manage a small number of static pages that were not updated in a timely manner or lost due to some certain reason. According to the rule table, each page was determined to access a static page URL or a dynamic page URL. Finally, a queue of staticization tasks was used to prevent the Content Delivery Network( CDN) server from occasional cache synchronization failing in principle caused by simultaneous staticization and failing to access to the static pages, and a recovery mechanism of automatical synchronization trigger by first user access failure was supplemented as another guarantee. This method was verified through a staticization task on a specific website. Based on about 30 page templates, the full website staticization and incremental staticization were done on about 20 000 pages. As a result, no error occurred and users could access the correct static pages in time. The features of this program are to classify the common cases of staticization, to make a targeted treatment for each case, and easy to extend. Practice has proved that this program can significantly improve the access speed, reliability and security of website group system.
出处
《计算机应用》
CSCD
北大核心
2017年第A01期321-324,339,共5页
journal of Computer Applications
关键词
静态化
定制化
内容管理系统
内容分发网络
可靠性
staticization
customization
Content Management System(CMS)
Content Delivery Network(CDN)
reliability