Subscribe
WENSH Affairs - Viewing a topic
<<  <  1  >  >>

新改造的lilina运行数天未见异常

good(0) bad(0) view(657) comments(0)
poster face
Posts: 1277
Level: ◆◆◆◆◇
Exp.: 10,241
Glamor: 1,215,589
Send a message to Wen Send an email to Wen


借用一句广告词来评价改造前lilina:已经懂得缓存的重要性,只需要把它做得更好。原版的lilina采用缓存存储已取得的feed,当客户端向服务器请求lilina的页面时,lilina执行以下步骤:

  1. 检查缓存是否需要刷新

  2. 如果缓存需要刷新,则刷新之(重新获取所有feed写入缓存)

  3. 把缓存中的内容返回给客户端,客户在浏览器上看到lilina页面

由于获取feed是比较耗时的,尤其当feed的数量较多时。每当遇上缓存需要刷新的时候,客户就要等很久才能看到lilina页面,甚至有时会超过php脚本限制时间(默认是30秒),那么客户就只能得到一个白屏。

其实这种情况是可以消除的,只需要将上面所列的执行步骤的第3步优先执行,无论缓存是否需要刷新,都先将当前缓存的内容给客户浏览,然后再在后台执行缓存刷新。那么客户就总能很快地看到lilina页面。

根据这个思路前几天对lilina进行了改造,之后页面如预料般总能快速响应。

Share/Save/Bookmark

Posted at 2006-01-10 18:55:33
WENSH Affairs - Viewing a topic
<<  <  1  >  >>
Add a comment
Comment will be posted by Guest
Your name/nickname:
For security purpose, please correctly answer this math question:

Note: Do not exceed 65535 bytes, HTML is not supported, but you can use NN Code

| | | Register | Forget password
Browse topics by category: Travel | Recipes | Fun | Tech | Science | Entertainment | Life | WENSH Affairs | Guests' Msgs | Abroad Info 05-06 |
| Links | Services | Leave a message | About NetNest |
Valid XHTML 1.0 | Valid CSS2 | WAI-A WCAG 1.0 | W3Csites.com Listed | Valid RSS 1.0 | Valid RSS 2.0
Copyright 2005-2008 WEN'S Horizon [30/0.052]
Powered by NetNest 2.0.2.080706 © 2004-2008 NetNest Group