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

HttpRequestMessage instance as parameter breaks server side caching #233

Open
netsrotr opened this issue Feb 5, 2018 · 0 comments
Open

Comments

@netsrotr
Copy link

netsrotr commented Feb 5, 2018

As of WebAPI 2 docs actions can have a HttpRequestMessage parameter, also additional to "normal" parameters and they do not influence the API call URLs. Samples (you can use the project's own demo project to repro):

public IEnumerable<Team> Get(HttpRequestMessage requestMessage)
or
public Team GetById(HttpRequestMessage requestMessage, int id)

If I try to cache the output, the default generated cache key contains the whole request data (Headers!!! Incl. user agent, cookies, etc. pp but these headers vary per browser and call! So 99% of the requests will result in a new cache key what makes the server side cache useless.
The WebAPI action resolver ignores such parameter, why does not CacheOutput?

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

1 participant