You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caching in DataSources (as enabled with an ‘expires’ value other than 0), can be made more fit for purpose by following the Last Recently Used principle instead of, currently, Last Recently Added. That way, the items that are requested more frequently tend to stay in the cache longer. Currently, if an item has been added a longer time ago, it will be removed if enough new items have been added to push it out of the cache FIFO.
This should be trivial to achieve using OrderDict’s move_to_end method in the OrderedDict subclass’ getitem to move the last requested item to the “last added” (end) position of the dict.
However, care must be taken to test this properly and differentiate it from the previous FIFO style in the unit tests.
The text was updated successfully, but these errors were encountered:
Caching in DataSources (as enabled with an ‘expires’ value other than 0), can be made more fit for purpose by following the Last Recently Used principle instead of, currently, Last Recently Added. That way, the items that are requested more frequently tend to stay in the cache longer. Currently, if an item has been added a longer time ago, it will be removed if enough new items have been added to push it out of the cache FIFO.
This should be trivial to achieve using OrderDict’s move_to_end method in the OrderedDict subclass’ getitem to move the last requested item to the “last added” (end) position of the dict.
However, care must be taken to test this properly and differentiate it from the previous FIFO style in the unit tests.
The text was updated successfully, but these errors were encountered: