9

Am looking for on disk LRU cache package in Python. Most of them are in memory cache.

Main reason is Database access is slow and have limited RAM for in memory LRU. However, large and fast SSD for LRU cache.

quantCode
  • 495
  • 1
  • 5
  • 12

2 Answers2

10

One solution is DISKCACHE : http://www.grantjenks.com/docs/diskcache/tutorial.html

The core of DiskCache is diskcache.Cache which represents a disk and file backed cache. As a Cache it supports a familiar Python Mapping interface with additional cache and performance parameter

tensor
  • 3,088
  • 8
  • 37
  • 71
8

You can also just go with shelve, which is part of the Python Standard SDK. https://docs.python.org/3/library/shelve.html

pedjjj
  • 958
  • 3
  • 18
  • 40