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

My Redis Cache Impl #621

Merged
merged 2 commits into from
Sep 14, 2015
Merged

My Redis Cache Impl #621

merged 2 commits into from
Sep 14, 2015

Conversation

yuzukwok
Copy link
Contributor

I think this is an important component.

@hikalkan
Copy link
Member

That's awesome! Thank you very much. I will merge and test it.

@hikalkan hikalkan added this to the ABP v0.7.1 milestone Sep 11, 2015
hikalkan added a commit that referenced this pull request Sep 14, 2015
@hikalkan hikalkan merged commit 2e2a6a6 into aspnetboilerplate:master Sep 14, 2015
hikalkan added a commit that referenced this pull request Sep 14, 2015
hikalkan added a commit that referenced this pull request Sep 14, 2015
hikalkan added a commit that referenced this pull request Sep 14, 2015
@hikalkan
Copy link
Member

I merged your code and refactored. Thanks. The only problem is the unit test is failing. How can we test redis? Is there a way of unit test it?

hikalkan added a commit that referenced this pull request Sep 14, 2015
@jaq316
Copy link
Contributor

jaq316 commented Sep 22, 2015

This is great! Is there any documentation on how to switch to using the RedisCache instead of the MemoryCache?

@yuzukwok
Copy link
Contributor Author

I found a bug in the remove key method of the class AbpRedisCache

public override void Remove(string key)
{
Database.KeyDelete(key);
}

=====>

public override void Remove(string key)
{
Database.KeyDelete(GetLocalizedKey(key));
}

Maybe hikalkan can fix it in the master branch,Thank you.

hikalkan added a commit that referenced this pull request Oct 11, 2015
hikalkan added a commit that referenced this pull request Jan 13, 2016
@hikalkan
Copy link
Member

I tested it with a simple unit test and see that it's working. To properly work tests, we need Redis installed and running.

I installed Redis from https://github.com/MSOpenTech/redis/releases/download/win-3.0.500/Redis-x64-3.0.500.msi (got link from https://github.com/MSOpenTech/redis/releases)

@hikalkan
Copy link
Member

Switching to RedisCache is easy:

  1. Install and run Redis as described in previous comment.
  2. In your module's PreInitialize method:
    IocManager.Register<ICacheManager, AbpRedisCacheManager>();
  1. Add connection string to your config file (web.config or app.config):
    <add name="Abp.Redis.Cache" connectionString="localhost"/>

@andmattia
Copy link

I try to switch to RedisCache but I catch an exception.

I add

  • in PreInitialize() add this row "IocManager.Register<ICacheManager, AbpRedisCacheManager>();" to ApplicationModule.cs in my application dll
  • I add the connection string on web.config
  • I add Abp.RedisCache to web dll
  • I recompile all and... not work! :(

So when I start my solution this is the output:
[DependencyResolverException: Missing dependency.
Component Abp.RedisCache.AbpRedisCache has a dependency on Abp.RedisCache.Configuration.IAbpRedisConnectionProvider, which could not be resolved.
Make sure the dependency is correctly registered in the container as a service, or provided as inline argument.]

I think somithing is missing... but what?

hikalkan added a commit that referenced this pull request Jan 15, 2016
@hikalkan
Copy link
Member

I fixed the problem and published Abp.RedisCache 0.7.8.1 nuget package. Please upgrade and re-try.

@andmattia
Copy link

Thks!
After upgrade to 0.7.8.1 it's work fine!

mattia

KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
KenProDev pushed a commit to KenProDev/aspnetboilerplate that referenced this pull request Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants