V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Tornado Documentation
http://www.v2ex.com/tornado/
Tornado on GitHub
https://github.com/facebook/tornado/
Tornado Gists
http://tornadogists.org/
kenneth
V2EX  ›  Tornado

如果要给Tornado程序设计一个Cache系统,你会考虑那些方面?

  •  
  •   kenneth · Jul 15, 2013 · 5628 views
    This topic created in 4683 days ago, the information mentioned may be changed or developed.
    缓存那些?模板,页面,结果集,还是什么?
    memcache,redis?
    大家来聊聊思路。
    6 replies    1970-01-01 08:00:00 +08:00
    yuelang85
        1
    yuelang85  
       Jul 15, 2013
    正在思考这方面的问题,搬个板凳等开课。。。。
    mkeith
        2
    mkeith  
       Jul 15, 2013
    我喜欢缓存UIModule输出的信息,直接加个@cache就行了。
    wenbinwu
        3
    wenbinwu  
       Jul 15, 2013
    我一般是django直接插入页面结果memcache,然后nginx试图通过url在memcache查找,不行再问django。当然这个只适合普通不常变得界面
    yemoluo
        4
    yemoluo  
       Jul 15, 2013
    模板缓存,是一定要开的
    页面缓存,如果可以静态化,也会静态化
    对于部分可以缓存的页面,用uimodule加上缓存
    结果集我一般是数据驱动删除缓存...

    能用memcache就不用redis... 不要问我为什么,我也不知道自己怎么有这个想法

    不过,以上那些,只有需要用到缓存才能抗压的时候才会考虑,一般我都懒得考虑
    parkman
        5
    parkman  
       Feb 13, 2014
    @mkeith uimodule + cache 怎么设置啊
    mkeith
        6
    mkeith  
       Feb 13, 2014
    @parkman

    class TestUIModule(BaseUIModule):
    @cache(....)
    def render(self):
    return someHtmlCode
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3354 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 449ms · UTC 12:45 · PVG 20:45 · LAX 05:45 · JFK 08:45
    ♥ Do have faith in what you're doing.