hazimdikenli
hazimdikenli

Reputation: 6019

asp.net cache sharing/invalidation between an asp.net-app and web-service app

I have a web service and a web app deployed on the same server, both applications cache some common data, and only the web app changes the data. So I need some simple mechanism to invalidate the cached data on the web service app, or an alternative caching mechanism so both apps use the same copy of the cached data. Right now when the cached data is changed I have no way of notifying the web-service app about the changes.

Asp.Net 4.5, SQL-2008, IIS 7.5

Upvotes: 0

Views: 94

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038740

You could use a distributed cache such as memcached or AppFabric for example. You might also wanna check http://sharedcache.codeplex.com/

If you cannot use a distributed cache, then you will have to provide an endpoint in the first application (accessible through HTTP) that will invalidate the in-memory cache. Then the second application could call this endpoint. Of course depending on your specific requirements you might want to secure this endpoint to avoid someone just sending simple requests to it and voiding the cache of your app whenever he finds fit.

Upvotes: 1

Related Questions