I have a library wich maps some REST api to some object model. So it's easy to work with the API. The problem is that every time I get some attribute of an object the library makes actual request to the server. That's not good from the performance view point.
What I want is to add functionality of memorizing the values of attributes for a some time (let say 5 min), and make the actual request only if the data is expired.
The question is that possible to do without actually changing the library's code? For example using decorators or something like that.