dcextensions
1.0.0
ห้องสมุดนี้ให้ส่วนขยายสำหรับ dogpile.cache สำหรับเวลาที่มีเพียงส่วนขยายเดียวแบ็กเอนด์หน่วยความจำที่สามารถ จำกัด ขนาด (จำนวนรายการที่จะแคช)
ในการติดตั้ง dcextensions ให้ใช้ pip
pip install dcextensionsเพื่อใช้แบ็กเอนด์หน่วยความจำ
from dogpile . cache import make_region
region = make_region (). configure (
'dogpile.cache.memory.limited' ,
expiration_time = 3600 ,
arguments = {
'cache_size' : 100 ,
'cache_dict' : my_dict
}
)อาร์กิวเมนต์ทั้งสองเป็นทางเลือก เมื่อใช้ my_dict จะต้องเป็นอินสแตนซ์ของ ordereddict