aliostad / CacheCow

An implementation of HTTP Caching in .NET Core and 4.5.2+ for both the client and the server
MIT License
847 stars 172 forks source link

Cache with Accept-Language #164

Closed flowdopip closed 8 years ago

flowdopip commented 8 years ago

Hi,

My API could have different response´s based on Accept-Language (Translated Content), it there any way to add this to the RoutePattern? I´ve try to override GetRoutePattern but doesnt work?

This could be a valid solution? Thanks

aliostad commented 8 years ago

Hi,

No... all you have to do is to set the VaryHeaders to new [] {"Accept", "Accept-Language"} resulting in Accept-language value considered in the cache key.

Any problems let me know.

flowdopip commented 8 years ago

Thanks,

I had not noticed that we can set vary params on handler ctor.