views:

87

answers:

2

Hi folks,

i've got a website that uses OutputCache attribute to cache pages. Works great.

Now, I'm in the middle of R&D'ing scaling up this site to be in a web farm. Along with the usual suspects for webfarm pain ... I've noticed (pretty quickly/obviously) that the OutputCache from Server_A doesn't invalidate the OutputCache from Server_B .. if a try and invalidate a single server's OutputCache. This makes total sense -> how can S_A 'tell' S_B to invalidate when they are physically 2 seperate machines, etc?

So - what are our options?

Velocity? I understand this will move the caching to a different layer .. which means that the final result (output) will always be required to be determined .. as opposed to the OutputCache whic remembers the final output content (yes, varby gives different versions, etc.. which is totally fine). So even though the poco or business objects are all sync'd, there's still that last rendering effort required (even if it's tiny .. compared to the effort to generate/sync business objects).

So yeah .. not sure of the options here and what other people do?

A: 

Take a look to memcached

What is Memcached?
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

From wikipedia
The system is used by several very large, well-known sites including YouTube[2], LiveJournal, Wikipedia/Wikimedia, Amazon.com, Wikia, SourceForge, Metacafe, Facebook[3] [4], Twitter[5], Fotolog, The Pirate Bay[6] and Netlog.[7]

A .NET Client here

Unfortunately it doesn't work very well with windows. It can be installed but the best integration is with linux.

Claudio Redi
MemcacheD is just like Velocity. I know cause i contributed to porting it to .NET x64 a while back. So unfortunately this is sorta not what i'm looking for right now .. but if that's what people are using .. then I do have an answer.
Pure.Krome
Take into account that Velocity is something very very new. It's not very frequently that a microsoft product it's good enough from version 1.0 :-)
Claudio Redi
True - and i'm not saying i want to go with Velocity, etc.
Pure.Krome
A: 

As you say above, ASP.NET output caching out of the box works on a per-server basis. However in ASP.NET 4.0 the whole caching infrastructure is pluggable. ScottGu has a blogpost on taking advantage of this for output caching. I've written some demo code that uses Velocity/AppFabric as a caching engine, which should do what you want - have a look at my blog here.

PhilPursglove