Make Cache (and Flexible method) even more flexible (and the DB much more lightweight) #54116
Unanswered
renatofrota
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Instead the current way of storing data and saying when it will expire, for then reading data with no additional parameter, we could store data (and the current timestamp is stored along the data, representing the idempotent information of when that data was gathered) and then we could read it passing as parameter "how old the data may be for us to consider it valid" - and this parameter could vary depending on what we will use the data for.
A resource index (paginated list), for example, may consider data gathered up 30 minutes ago as valid, while the individual resource listing page may consider data as fresh if it is as recent as 5 minutes or less. All this may be infered from that single timestamp (when data was stored) and comparing to the current time.
Additionally, we would not need additional entries in the cache table for the flexible() method.
TL;DR A single database entry with key + data + creation timestamp is all we need for all the cache storing/reading methods, much simpler and lightweight.
Beta Was this translation helpful? Give feedback.
All reactions