gpt4 book ai didi

django - Django 文件系统缓存线程安全吗?它是跨进程的吗?

转载 作者:行者123 更新时间:2023-12-04 18:02:07 24 4
gpt4 key购买 nike

我需要缓存 10MB 以上大小的列表,在 Django 文件系统缓存中这样做安全吗?

或者有更好的方法吗?

最佳答案

我会仔细检查 Python DiskCache .

Django is Python’s most popular web framework and ships with several caching backends. Unfortunately the file-based cache in Django is essentially broken. The culling method is random and large caches repeatedly scan a cache directory which slows linearly with growth. Can you really allow it to take sixty milliseconds to store a key in a cache with a thousand items?

In Python, we can do better. And we can do it in pure-Python!

关于django - Django 文件系统缓存线程安全吗?它是跨进程的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33582903/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com