Caching for Webserver

**Operating system: Debian
**OS version: 10

Hi community,

I’m running Virtualmin on an Apache Webserver.
What I want to do is to activate caching for it, since the TTFB is pretty long, more than 3 seconds.
I’ve red something about the Disk Caching feature of Apache and also Varnish cache.
Which of those are better?
I’ve on my server 3 WordPress sites and one Moodle instance.

Thanks a lot

You need to figure out why your app is so slow. Caching can only help with a small subset of requests (static assets, primarily, though there are some app caches that can make other kinds of requests faster…but it won’t be Apache or Varnish), and it won’t solve your problem.

What execution mode are you using? Are you sure you have sufficient resources (memory and CPU) to adequately serve your app?

Just want to add to that - opcache is enabled by default when Virtualmin is installed, so it will cache maybe 10,000 PHP files on your system. You already have a cache, @fabi.

It’s Wordpress doing it. That app has become a black hole of performance robbing garbage. It’s code and apps have become so inundated with performance sucking scripts it’s beyond belief.

Caching isn’t really going to help a whole lot because odds are it’s the plugins you’re using and the poorly written code therein that causes the delays.

About the best caching tool for Wordpress is W3 Total Cache. It will help if you have a lot of images on the site, but if you’re running bloated plugins there’s only one way to speed up Wordpress: get rid of every plugin you can.

Unlikely. Probably one or more of the WordPress plugins in use. WordPress itself is pretty good.

Yes. But that’s Wordpress’ fault. They no longer regulate or test the apps like they used to. They’ve allowed it to get so bad that you simply can’t have any plugins at all, which is my entire point in that post.

The only way for Wordpress to not suck is to have no apps, which sort of removes the entire point of having Wordpress to begin with as that is why it was designed - to use apps for specific features.

I run 5 Wordpress sites. They all are slow and they run on minimum apps. This is one of them: https://www.morleysmuscle.com/

That one was so slow I put it on it on Greengeeks by itself on a plus service account and it’s still slow. It runs only 6 plugins due to Woocommerce. That’s it.

Hi there @ all,

I appreciate a lot your answers and thank you very much.
Is there maybe a option to test if OPcache is working?
I’m using the Divi theme, I know it’s not perfect for WordPress. At the moment no other plugin is activated. The website is about 2M big.
My problem is actually, that the server response time is pretty high, between 2-3 seconds.
Any idea where I can have a look to get this more down?

Thanks a lot @ all

Divi is awful. It’s one of THE slowest themes you can get, especially on a shared hosting plan.

Try an experiment: Switch the theme to the stock Twenty Nineteen or Twenty Twenty template or something like that and see how your speed is. If the site jumps to life and moves along just fine, then it’s just Divi that’s screwing you up.

Hi @ everyone,

Thanks a lot for all your answer.
Yeah I know that Divi is not pretty well for it, but I don’t have any experience in programming a website.
I’ll try to do some testing, maybe I’ll have some success to optimise it.

You can try Hummingbird. It does a pretty decent job. Also, if you haven’t bought Divi and are using a free version, you might try switching to OceanWP. It’s still pretty resource hungry but it’s not nearly as bad as Divi.

Hi fabi

maybe it is of interest - i’ve done some scripting using a post-server.sh script in virtualmin.
Basically it configures a nginx (as caching proxy) in front of the apache so the static files
are delivered by nginx, php is proxied to apache (which runs on localhost only). On saving virtual server settings in Virtualmin the nginx config is written for this virtual server, too.

I could share this, if it makes sense for you.

About the opcache question, I’m using a php script within public_html when I have to clear it from extern, this at least shows if it is installed or not:

if (extension_loaded('Zend OPcache')) {
    if (ini_get('opcache.enable')) {
        opcache_reset();
        echo "Zend OPcache resetted.<br>";
    } else {
        echo "Zend OPcache is installed but not enabled.<br>";
    }
}

if (extension_loaded('apc') && !extension_loaded('apcu')) {
    if (ini_get('apc.enabled')) {
        apc_clear_cache('opcode');
        echo "APC opcode cache resetted.<br>";
    } else {
        echo "APC opcode cache is installed but not enabled.<br>";
    }
}

HTH

Divi was build for folks who have no idea about how to made web better so - it’s a bunch of crap ware and add ons which will make your wp very slow… in those days if your site does not reach me without is under 30 seconds, you’re gone, blocked and dusted at least on my mobile devices. I used to be big fun of elegant themes buts all themes was a bit joke. Best site you can deliver content is to be much simplest as you can be, users want content not flashy rubbish around…

Think about it…I now host blog entries in pure html static site, no coding need it I wrote bash script which code whole web site for me…no Hugo or others. Just some js and html it loads under 20ms in USA meaning you are light years in USA from me

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.