推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
wico77
V2EX  ›  Python

python 如何把函数结果缓存到硬盘系统?

  •  
  •   wico77 · Jan 25, 2016 · 2751 views
    This topic created in 3896 days ago, the information mentioned may be changed or developed.

    看到一篇文章,把函数结果缓存到内存,文章原文 http://caiknife.github.io/blog/2013/08/13/python-decorator/
    我的问题是能不能把函数结果缓存到硬盘,因为如果对于搜索站,查询词太多的话对内存要求太高,能缓存到硬盘就好了。

    5 replies  •  2016-01-26 02:09:56 +08:00
    virusdefender
        1
    virusdefender  
       Jan 25, 2016
    pickle
    wico77
        2
    wico77  
    OP
       Jan 25, 2016
    @virusdefender pickle 是持久化保持结果,有没有能设置缓存时间的
    paulw54jrn
        3
    paulw54jrn  
       Jan 25, 2016
    直接 Redis 解决?
    virusdefender
        4
    virusdefender  
       Jan 25, 2016
    @wico77 那应该是文件系统的问题了
    tinyproxy
        5
    tinyproxy  
       Jan 26, 2016 via iPhone
    @wico77 那你检查缓存文件的修改时间啊,超过 ttl 删了重跑就是了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2589 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:57 · PVG 13:57 · LAX 22:57 · JFK 01:57
    ♥ Do have faith in what you're doing.