Cache entry with data, timestamp, and access count.
| 9 | |
| 10 | @dataclass |
| 11 | class CacheEntry: |
| 12 | """Cache entry with data, timestamp, and access count.""" |
| 13 | data: bytes |
| 14 | timestamp: float |
| 15 | access_count: int = 0 |
| 16 | size: int = 0 |
| 17 | |
| 18 | def __post_init__(self): |
| 19 | if self.size == 0: |
| 20 | self.size = len(self.data) |
| 21 | |
| 22 | |
| 23 | class LRUByteCache: |