dnn.rediscachingprovider
dnn.rediscachingprovider copied to clipboard
Clear cache with prefix key and improve performance
I found redis caching provider always clear all data in cache.
When clear cache with prefix key, it should clear only key with specific prefix. Ex. Given 3 keys below Portal-1_ Portal-1_en-US Portal-2
If DNN call method Clear in RedisCachingProvider.cs and send type = 'Prefix', data = 'Portal-1'. It should clear Portal-1_ and Portal-1_en-US, not clear cache with key Portal-2.
Moreover, the existing code loops for clearing. I suggest to send Lua script to loop on server side to clear cache.
I provide code at http://pastebin.com/itZH6Az7
Could you please review and update RedisCachingProvider version 1.0.4 (I use DNN 7.4.x)?
Best regards, Gai
I love it! Going to add the change to work with 7.4.x and 8.x versions
Thank you :)
Howerver, I think it have to improve clear cache for other key types (ex. PortalCascade). I will update when I know
I have added the LUA script on the 2.1.0 version. I will revisit this to find a way of partially clearing the keys.