With Memcached and Squid, is there a need for ASP.NET caching?

With squid, we can cache web pages. I'm not sure if it provides the same number of caching methods as ASP.NET caching (I mostly use ASP.NET), but it is a tool for caching web pages.

Then we have memcached, which can cache the database tables. I believe this is correct and it is similar to SqlCacheDependency (correct me if I am wrong).

However, is there any situation in a large web application where one can find a place to use memcached, squid and ASP.NET (or PHP, JSP-application framework-level) caching.

Thank!

0


source to share


2 answers


You may find that caching entire pages is too coarse-grained, and database table caching doesn't give you enough boost, leaving a lot of need to cache things.



Let's say, for example, you had an app that showed the name of the logged in user on every page. Whole page caching doesn't really work, so you need to reset the level and cache somewhere within the application.

+2


source


Then we have memcached, which can cache the database tables. I believe this is correct and it is similar to SqlCacheDependency (correct me if I am wrong).

Memcached is a distributed hash table. The main advantages of built-in .NET caching are that your cache is scalable (you can add as many memcached boxen as you want) and syncronized (all your web servers have access to the same stuff and data is invalid or updated from the same network server instantly applies to everything)

In terms of performance, it is worse than the .NET cache (you are looking at objects on servers, as opposed to looking in memory on a single machine)



However, is there any situation in a large web application where one can find a place to use memcached, squid and ASP.NET (or PHP, JSP-application framework-level) caching.

For the reasons above, I can imagine a two-tier cache, using the .NET cache first and then memcached. (e.g. Get () looks at memcached, stores the result in the .NET cache, which expires after 10 seconds, and then uses the .NET cache for all get calls with the same cache key for the next 10 seconds, rinsing, repeating)

Thus, you get the performance of in-memory cache lookups without the cost of network I / O in a pure memcached solution with the benefits of memcached and synchronization.

+2


source







All Articles