Making WordPress faster using memcached and W3TC caching plugin

Post Reply
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

First we need to install memcached service.
In SSH, as root, run:

Code: Select all

v-update-myvesta
v-commander 'inst memcached'
Now we need to install "W3 Total Cache" plugin in WordPress.

After you install W3TC, download https://raw.githubusercontent.com/myves ... /W3TC.json as file to your computer.
Import that file in W3TC settings.

Tags:
wpinsites
Posts: 14
Joined: Thu Jul 30, 2020 7:06 am

Cheers for that.

With various metrix sites throwing a little fit if browser cacheing isn't enabled, what are your thoughts on there maybe being a checkbox option with an input field for the cache expiry value, on NGINX basic options page to add it to (or remove it from) the server section of the conf?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

If you think on this:

Code: Select all

    # File cache settings
    open_file_cache          max=10000 inactive=30s;
    open_file_cache_valid    60s;
    open_file_cache_min_uses 2;
    open_file_cache_errors   off;
to be honest, I never played with that, so I would leave these default values.
wpinsites
Posts: 14
Joined: Thu Jul 30, 2020 7:06 am

I believe those settings are to do with the file cache on the server? I'm meaning something like this to go into the "server" config section of the NGINX conf to set browser cache expiry:

Code: Select all

    location ~* \.(txt|xml|js|css|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg|jpg|jpeg|png|gif|swf|webp)$ {
        expires 8d;
    }
The period is arbitrary and could be set by the user via an input. Easy enough to manually add, but a fairly common thing to enable browser cacheing these days.
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

but it's already 'max' - https://github.com/myvesta/vesta/blob/m ... g.stpl#L15

Code: Select all

expires        max;
max
This is the opposite of the “epoch” value. The Expires header will be equal to “31 December 2037 23:59:59 GMT”, and the Cache-Control max-age set to 10 years. This basically means that the HTTP responses are guaranteed to never change, so clients are free to never request the same thing twice and may use their own stored values.
wpinsites
Posts: 14
Joined: Thu Jul 30, 2020 7:06 am

So it is! :oops:
Ominae
Posts: 19
Joined: Fri Jul 10, 2020 4:30 am

:shock: oooh !!!

Do you recommend this improvement, on woocommerce sites?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Yes, it will works without any issues.
websystems
Posts: 6
Joined: Wed Oct 21, 2020 4:27 pm

Hello

I have similar issue. VPS with 16 CPU cores and 16G RAM, hardware utilized in 10%. Apache+Nginx+Mysql+PHP-FPM7.4+CloudFlare and TTFB for WP website (good theme, some plugins, nothing special) 1,5-2sec :/ It is for the first load in the browser, then it is much faster...

Played with some options, but no luck so far. Any tips welcome :)
maag
Posts: 7
Joined: Fri Apr 09, 2021 3:40 pm
Your location: Uruguay

websystems wrote: Tue May 04, 2021 11:25 pm Hello

I have similar issue. VPS with 16 CPU cores and 16G RAM, hardware utilized in 10%. Apache+Nginx+Mysql+PHP-FPM7.4+CloudFlare and TTFB for WP website (good theme, some plugins, nothing special) 1,5-2sec :/ It is for the first load in the browser, then it is much faster...

Played with some options, but no luck so far. Any tips welcome :)
same here, 10 cores and 30 gb of ram, wp admin is sssooooooooooo slowly and sites same
Post Reply