Skip to content
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

Support configuration for UrlMatcher #126

Closed
Nyholm opened this issue Dec 21, 2016 · 6 comments
Closed

Support configuration for UrlMatcher #126

Nyholm opened this issue Dec 21, 2016 · 6 comments

Comments

@Nyholm
Copy link
Member

Nyholm commented Dec 21, 2016

.. or we should at least document how you use the UrlMatcher with the bundle. I want to write something here: http://php-translation.readthedocs.io/en/latest/guides/configure-httplug.html#configure-caching

All request to Google API should be cached but no others.

@sagikazarmark
Copy link
Member

Do you mean RequestConditional plugin and a RequestMatcher?

@Nyholm
Copy link
Member Author

Nyholm commented Dec 22, 2016

Yes, I've never worked with the RequestConditional plugin. We should add support for that plugin.

@sagikazarmark
Copy link
Member

sagikazarmark commented Dec 22, 2016

Hm, yes, it sounds like a good idea. Although we have a RequestMatcher interface, I guess most of the times we want to use the default implementation, so I suggest the following plugin configuration:

request_condition:
    # optional if something from bellow is provided
    matcher: matcher.service

    # these are optional if the matcher service is provided
    # and creates an instance of the default implementation
    path: null
    host: null
    methods: []
    schemes: []

I don't recall how we solved multiple instance of the same plugin: by naming or passing an array to the plugin config?

@ostrolucky
Copy link
Collaborator

As far as I understand, what is asked for here is ability to configure CachePlugin with RequestMatcher. For this to implement, https://github.com/php-http/cache-plugin should be first changed to support this. I don't see any other use case for this conditional feature. But currently very few things in CachePlugin are configurable via DSL. For example, in my experience respect_response_cache_directives, default_ttl and cache_lifetime have to be changed often and there is no way to change it in config itself.

@dbu
Copy link
Collaborator

dbu commented Oct 11, 2021

given the age of this issue, it seems to me like there is not much need for this. not strictly against it, but having too much flexibility also has a cost for the users.

For example, in my experience respect_response_cache_directives, default_ttl and cache_lifetime have to be changed often and there is no way to change it in config itself.

having such things configurable would seem like a good idea to me.

@ostrolucky
Copy link
Collaborator

Agreed, let's close then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants