unsplash / unsplash-php

👻 Official PHP wrapper for the Unsplash API
MIT License
415 stars 74 forks source link

What about query caching? #104

Closed goodwin74 closed 4 years ago

goodwin74 commented 4 years ago

Does the library have a query caching implementation, as required to meet limits?

aaronklaassen commented 4 years ago

No, it does not. Though you're welcome to implement a response cache in your client application.

goodwin74 commented 4 years ago

No, it does not. Though you're welcome to implement a response cache in your client application.

Is there at least approximately a solution to this issue? How can I implement a cache on the client to reduce the number of API requests? After all, each search query is almost unique due to different words and declensions :( And the effect of caching will be practically zero, since there will be very few identical requests.

Help, please, how to be?

lukechesser commented 4 years ago

It can be implemented in a lot of different ways and isn't something specific to the job of the API client to do

goodwin74 commented 4 years ago

It can be implemented in a lot of different ways and isn't something specific to the job of the API client to do

However, I haven’t found a ready-made solution anywhere, given the search query, where each request is unique and essentially requires processing the request in order to combine similar queries into one. Otherwise, caching will simply be useless, due to synonyms and declensions of words, and as a result, almost 99% of the uniqueness of each request. It would be nice to get such a solution from Unsplash - this would help many to improve the quality of requests and reduce their number to fit in the limits of requests!