Reputation: 6508
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?
Upvotes: 5
Views: 3369
Reputation: 13221
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.
Upvotes: 5
Reputation: 648
Nginx has some nice features if you just need very basic caching, but Varnish lets you do active purges by URL or header matching, edge side includes so different parts of your pages can have different TTLs, and lots of other trickery because it has a very flexible configuration language.
If you really want to seriously cache and reduce load on your backends, I'd go with varnish, but it's going to be a lot more work to set up than just adding a few directives to your nginx.conf.
Upvotes: 3