- Notifications
You must be signed in to change notification settings - Fork524
Implement first idea of the cache provider#488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
willdurand commentedJan 19, 2016
👍 |
willdurand commentedJan 19, 2016
Also, Symfony 3.1 will have a Cache component. |
Baachi commentedJan 19, 2016
Oh didn't know that, but wouldn't it be better to build against thepsr/cache interface? |
drupol commentedJan 21, 2016
I've implemented it in the Drupal module using custom code, without strategy. Code here:https://github.com/drupol/geocoder/blob/8.x-2.x/src/Plugin/Geocoder/Provider.php#L72 |
toin0u commentedJan 25, 2016
@Baachi Symfony added the PSR-6 implementationsymfony/symfony#17408 :) |
Baachi commentedJan 25, 2016
@toin0u Cool didn't know that 👍 |
joelwurtz commentedJan 29, 2016
See#487 if it's only for HTTP request we (php-http) already provide a plugin for caching response with PSR6, this will maybe allow to reduce the maintenance on your side |
Baachi commentedFeb 1, 2016
@joelwurtz I know that httplug have a caching system but it uses the
If this is possible through httplug, let me know. |
joelwurtz commentedFeb 1, 2016
The CachePlugin as an option to respect / ignore cache headers :
In fact the You also give me an idea about introducing a StaleCachePlugin, like caching response in another cache with a longer ttl, and if a following request / response is in failure, it reuse the cached one. |
Baachi commentedFeb 1, 2016
@joelwurtz This sounds indeed interesting and would also cover this use case.
Yes this is right, but how would you detect if there is an error in this response? Geocoder already know this already and throw an exception if the provider hit the api limit or there is an other error. |
Baachi commentedFeb 1, 2016
@geocoder-php/geocoder ready for review 👍 |
toin0u commentedFeb 9, 2016
@Baachi Good job! It looks good 👍 Just few missing phpdocs :) |
willdurand commentedFeb 10, 2016
👍 |
willdurand commentedJul 18, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Baachi any update on this PR? |
Baachi commentedJul 24, 2016
Will try to finish up this PR this week. |
Nyholm commentedJul 25, 2016
FYI: One could use the CachePlugin to HTTPlug. |
Baachi commentedNov 9, 2016
@willdurand do you still want this PR? If yes i will add the missing docs |
Nyholm commentedNov 9, 2016
Do we need this PR? Doesn't that solve the cache problem for us? |
Baachi commentedNov 9, 2016
@Nyholm this is the question, the only thing which isn't currently not covered is the |
Nyholm commentedNov 9, 2016
I would vote for not merging this and add |
Baachi commentedNov 9, 2016
@Nyholm Should i open an issue on the |
Nyholm commentedNov 9, 2016
I think this implementation looks good. Since it is not too much code, I suggest to open a quick PR and we'll discuss it there. Do not spend too much time (or none) at the tests until you got some feedback. |
atymic commentedJul 1, 2019
Is this PR still needed? |
Baachi commentedJul 1, 2019
I think this PR is not needed anymore :) |
atymic commentedJul 1, 2019
Thanks@Baachi 😄 |
Hey guys,
PSR6 has been released weeks ago and so we have a standard for caching. The feature has been wished thousand times so i started to work on it.
Currently this is only a proof of concept and i will finished it if we all fine with the idea.
My intention is currently: We provide multple strategies and the user can decidehow he wants to cache the response.
Currently i wrote thestale-if-error strategy and theexpire strategy, because i think these are the most common behaviours.
Please provide feedback 😄