-
Notifications
You must be signed in to change notification settings - Fork 18
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'respect_response_cache_directives' is ignored #91
Comments
hm, good question indeed. it looks like one can only add additional directives to respect, but not remove no-cache and max-age. this had been added like this with the original i see that the serverCache factory method does not tamper with that option, so maybe you could use that? (you still need to set the option to empty array, otherwise the OptionsResolver will add a bunch of directives to respect. |
The issue is that I'm not using php-http directly but through the php github API (https://github.com/KnpLabs/php-github-api). |
oh i see. you could extend the (Builder)[https://github.com/KnpLabs/php-github-api/blob/9afaf87f99c6c2acde80b6925d1b97a70ece8cb5/lib/Github/HttpClient/Builder.php] and overwrite the addCache method. while i agree that the current behaviour is unexpected and strange, i am afraid to change it as a bugfix - it would be significant behaviour change |
unfortunate timing btw, we just tagged 2.0 2 weeks ago. otherwise we could have declared it one of the important BC breaks of 2.0. we could add a new factory method that does not force any of the options and deprecate this one, to have a sane upgrade path. and once that is released, we could change the php-github-api to use the new method. do you want to work on that? |
We have the following code in CachePlugin.php:
If I pass a config with
'respect_response_cache_directives' => []
, it is ignored and replaced with['no-cache', 'max-age']
.I wanted it to always cache any page regardless of the server directives. It's impossible to do that right now. I'm not sure what's the intention of the code above.
The text was updated successfully, but these errors were encountered: