Caching
Caching
Caching of server responses is a good web practice and we strongly recommend and support caching our data. In Roanuz Cricket API, every response comes with a Cache object. It aids in the storing and retrieving of the corresponding responses.
The Cache Object
The Cache object contains a set of instructions and recommendations that will help you with the caching of data and handling of the cache internally.
The cache object contains four properties:
Cache Key
The is the key we recommend to be used for caching. You can use it while you cache a response of that API.
Maximum Cache Validity
The
gives away the time the data from a response can be considered to be fresh. It gives you a heads up on when you should be checking for updates in the data.The time will always be longer than the time. The you how long you can cache the data while the tells you when you should be checking for updates.
Etag
The
helps you implement the HTTP Etag mechanism. The ETag HTTP response header is an identifier for a specific version of a server response. It helps in efficient caching and saves considerable bandwidth, as if the content has not changed between two requests, the server does not have to resend a full response. In most responses, the and values will be the same.
The HTTP caching process, if implemented properly, can result in a lot of bandwidth savings. We, at Roanuz, have always been recommending and providing support for caching keeping your best interests in mind.