NginX Proxy Apache and Caching

Hexweb

Verified User
Joined
Apr 29, 2014
Messages
64
Location
Netherlands
A few days ago i installed the nginx proxy for apache with the Howto from alex.

Now i have a further question about nginx and caching!

Is the standard nginx caching good enough or is it better to use another caching program. (Like APC / Memcached / Varnish)

If it is the later of the two. Which one of them is better. I tried APC/Memcached a few years ago but they consumed to much resources.

Already thanks for the help.
 
A few days ago i installed the nginx proxy for apache with the Howto from alex.

Now i have a further question about nginx and caching!

Is the standard nginx caching good enough or is it better to use another caching program. (Like APC / Memcached / Varnish)

If it is the later of the two. Which one of them is better. I tried APC/Memcached a few years ago but they consumed to much resources.

Already thanks for the help.

If you're using nginx as a reverse proxy to apache, then it is just handling static files and doesn't touch PHP. APC/Memcached are PHP caching.
 
Oke so for static files i don't need a phpcaching method.

But what is the "Best" caching method?

APC / Memcached / Varnish

or one of these opcode caching methods
ZendOptimizerPlus / eAccelerator
 
Hello,

Static files has nothing to do with APC, Memcache, eAccelerator, etc. Why do you need to cache them additionaly? Isn't your disk caching good enough?

PHP scripts might need to use additional caching to speed the things up. And there is no single answer which would cover and work the same good on all the servers. While APC, eAccelerator and other phpcaching extensions are usualy use RAM to store results, Varnish can use both HDD and RAM. Varnish is good enough but still as a self-standing service it requires additional RAM and CPU.

For now I've got customers with servers which are using APC, Memcache, eAccelerator, Varnish. And one should know the server from inside to choose the best.

I won't say this or that is 100% suitable solution for all possible cases, you need to test it yourself and find what is the best for you.

Still if you say

I tried APC/Memcached a few years ago but they consumed to much resources.

then Varnish is not a good choice for you, I'd rather say. As it would probably consume much more resourses. I guess there have been passed great time since that, and I'd suggest that you give it one more try. This time you might find different results.
 
Static files has nothing to do with APC, Memcache, eAccelerator, etc. Why do you need to cache them additionaly? Isn't your disk caching good enough?

I found that out a few hours back. But what i want is PHP caching. To quicken the load of websites that running on my servers. The loading times aren't bad but if those can improve it's only better. (Most websites are joomla/wordpress/zencart based)

then Varnish is not a good choice for you, I'd rather say. As it would probably consume much more resourses. I guess there have been passed great time since that, and I'd suggest that you give it one more try. This time you might find different results.

When i tried APC/Memcached i had a different server with less capacity. The problem then was that the whole harddisk was piling up.
But i'm going to try Zend OPcache for the PHP caching and will report back with my results.
 
Whatever you choose you should care of the following:

1. Your caching system should differ guests, and authorised users, as they might need to see different content. If your caching system can't do that, you might need to choose another. Usually it's done with cookies.

2. Your caching system should differ and respect network devices or language preferences, as if your software shows different code for mobile devices and and PCs, and/or shows different languages depending on a visitor's preferences, or uses other dynamic content.

3. If you track visitors and/or downloads with a PHP script, then if your visitor sees a cached page, your tracking system might not count such a visit/download.

That's common issues which you might face excluding those at system level with CPU and RAM.
 
Back
Top