简体   繁体   中英

Bundle similar REST API requests of different clients

I'm currently working with an REST API interface and want to reduce my network stress and data accessibility by bundling incoming requests from multiple clients to avoid requesting the same informations. So I need to bundle my individuals requests, call them with an broker like application and respond only the required information to the specific clients.

I thought about wrapping a Graphql implementation around my REST API but it seems to be bit of an overkill. Are there any other workarounds (other than using a cache due to licensing problems) to fulfill the criteria of my use case?

If you don't want any complex, you can implement your custom solution with a simple API service that keep a cache of requested data. Each time that a request come, the copy (if exists, if not a new one must be done) is returned and after the original source will be requested to check if a data refresh is required.

Also, you can save some statistic values as cache requires number, consume times, etc. It can be help you without much effort and you can use some fast key-value database engines to build that as leveldb , for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM