Hi,
I was wondering if there is any way to store disposable items in cache?
Basically, if i could achieve functionality like this: <a class="postlink" href="http://stackoverflow.com/a/32706574/6223751">http://stackoverflow.com/a/32706574/6223751</a> for a cacheitem, it would be great.
Thanks
3 Answer(s)
-
0
While cache items should be simple and does not contain desctuction code normally, it may be needed. Can you create an issue for that on Github: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new">https://github.com/aspnetboilerplate/as ... issues/new</a>
-
0
Hi hikalkan,
Thanks for your response. As abp cache is extending memory cache, it could be nice if we can use the methods provides. I agree that is not best practice to storing disposable items in cache, however this is a gray zone :D it is a costly initialization and wanted to test whether cache or singleton performs better in long term running. In addition to the previous question, ive also tried redis cache. I noticed that if i try to clear all caches in initialize method(as redis is still running after application restart and previous cached items persist) i get an exception. I didnt had the time to test whether the exception is thrown while trying to clear the container of holding disposable objects or not. Maybe tomorrow.
-
0
This discussion is continued here: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1104">https://github.com/aspnetboilerplate/as ... ssues/1104</a>