You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented the Redis OutputCache using the Azure Redis service.
On top of the pages need to cache: <%@ OutputCache VaryByParam="*" Duration="600" %>
After access a random page and I check the key in Redis database is has saved like: /_a2/monitor.aspxHQNactionVtestFCDE
So running the below line of code, will remove this cache item (and it worked). HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test", "RedisOutputCache")
Now I have updated the same page adding the varyByCustom the the OutputCache directive: <%@ OutputCache VaryByParam="*" varyByCustom="userhash" Duration="600" %>
Now accessing the page and checking the key in Redis database it is saved like: /_a2/monitor.aspxHQNactionVtestFCNuserhashVcc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59DE
You see the added userhash hash value, this is nice and worked as axpected.
But now here comes the problem: How do I clear this cache item.
This is not working: HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test", "RedisOutputCache")
Also tried: HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test&userhash=cc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59", "RedisOutputCache")
And also tried: HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test {userhash:cc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59}", "RedisOutputCache")
Is there an way to remove this cache item on using the varyByCustom option?
Any help is most welcome!
Joël
The text was updated successfully, but these errors were encountered:
This is more of asp.net question. Output cache provider it self is very simple. it put/get/deletes key that asp.net request it to. Why asp.net is not sending remove request is the question?
LS,
I have implemented the Redis OutputCache using the Azure Redis service.
On top of the pages need to cache:
<%@ OutputCache VaryByParam="*" Duration="600" %>
After access a random page and I check the key in Redis database is has saved like:
/_a2/monitor.aspxHQNactionVtestFCDE
So running the below line of code, will remove this cache item (and it worked).
HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test", "RedisOutputCache")
Now I have updated the same page adding the varyByCustom the the OutputCache directive:
<%@ OutputCache VaryByParam="*" varyByCustom="userhash" Duration="600" %>
Now accessing the page and checking the key in Redis database it is saved like:
/_a2/monitor.aspxHQNactionVtestFCNuserhashVcc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59DE
You see the added userhash hash value, this is nice and worked as axpected.
But now here comes the problem: How do I clear this cache item.
This is not working:
HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test", "RedisOutputCache")
Also tried:
HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test&userhash=cc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59", "RedisOutputCache")
And also tried:
HttpResponse.RemoveOutputCacheItem("/monitor.aspx?action=test {userhash:cc6ef5b7173286704cef942d5577b88bd81f2cce71a0dcdc8676d3a815e68b59}", "RedisOutputCache")
Is there an way to remove this cache item on using the varyByCustom option?
Any help is most welcome!
Joël
The text was updated successfully, but these errors were encountered: