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

Provide extensible MakeBaseKey #230

Open
JobaDiniz opened this issue Jan 27, 2018 · 0 comments
Open

Provide extensible MakeBaseKey #230

JobaDiniz opened this issue Jan 27, 2018 · 0 comments

Comments

@JobaDiniz
Copy link

JobaDiniz commented Jan 27, 2018

The method MakeBaseKey cannot be changed, therefore, one cannot change how cache invalidation is applied.

In my case, baseKey should be Controller+Action+TenantId, and as it is, I cannot change that. My application is a multi-tenant app, so it shouldn't invalidate cache throughout tenants.

[HttpGet]
[Route("{id:guid}")]
public IHttpActionResult GetById([TenantId] Guid tenantId, Guid id)

[HttpPost]
[Route("")]
public IHttpActionResult Create([TenantId] Guid tenantId, Model model)

When a POST is issued, all cache of all tenants are invalidated, but it should only invalidate the current tenantId's caches

Possible Solution

Create a new method in ICacheKeyGenerator string MakeCacheBaseKey(HttpActionContext context) - verify which parameters can be passed.
Use this new method when generating BaseKeys

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