0

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

they are both available only over LAN, so I like using an end point to invalidate the cache store. I just started reading through AppFabric, is it possible to use its caching features for a shared cache?
Yes, AppFabric is another distributed cache that you could use in this case which will allow you both applications to share the same cache and invalidating it from one app will invalidate it in the other. In this case you don't need any HTTP endpoints.
thanks for fast reponse, I'll keep reading through AppFabric.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.