mirror of
https://github.com/ltcptgeneral/cs239-caching.git
synced 2025-09-23 15:10:19 +00:00
add no cache and ideal cache,
move printing cache reports to util file
This commit is contained in:
16
app/cache/idealcache.py
vendored
Normal file
16
app/cache/idealcache.py
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
from .cache import Cache
|
||||
from database import get_user_profile
|
||||
|
||||
class IdealCache(Cache):
|
||||
|
||||
def __init__(self, limit: int):
|
||||
pass
|
||||
|
||||
def get(self, key):
|
||||
return get_user_profile(key)
|
||||
|
||||
def put(self, key, val):
|
||||
return False
|
||||
|
||||
def invalidate(self, key):
|
||||
return False
|
15
app/cache/nocache.py
vendored
Normal file
15
app/cache/nocache.py
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
from .cache import Cache
|
||||
|
||||
class NoCache(Cache):
|
||||
|
||||
def __init__(self, limit: int):
|
||||
pass
|
||||
|
||||
def get(self, key):
|
||||
return None
|
||||
|
||||
def put(self, key, val):
|
||||
return False
|
||||
|
||||
def invalidate(self, key):
|
||||
return False
|
Reference in New Issue
Block a user