views:

297

answers:

1

I really like nginx.

But recently I've found that varnish gives you an opportunity to implement smart caching revers proxy layer(with URL purging). I have a cluster of mongrels which are pretty resource-intensive so if this caching layer can remove some load from mongrels this can be a great thing.

I didn't find a way to implement the caching layer(with for application pages; static content is cacheable of course) same with nginx..

Should I use Varnish instead? What would you recommend?

+2  A: 

I do not know what you mean under "smart", but anyway Nginx has caching starting from 0.7 branch. There are many parameters to tune, e.g.

  • you can have various TTLs for different return codes,
  • ability to return stale content when application does not respond
  • possible to limit the total size of the cache on disk
  • you can define what pieces of information will be used to generate a cache key.

The documentation is here

Alexander Azarov