Wordpress W3 Total Cache

All about creating websites!
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Wordpress W3 Total Cache

Post by ayu »

So I tried using W3 Total Cache today for Wordpress, and at a first glance it's pretty amazing, speeding up the site loading from 7 seconds to 1.3 seconds (running the blog on a raspberry Pi, which is very slow).

I ran into a problem though, and I'm not sure if it's related to W3 or Permalinks, but W3 wanted me to change my Permalinks settings, which I did (changed to the "day and name" setting).
But now I get 404 on anything else than the front page.
I found loads of people with the same problem, and they all solved it with 2-3 different solutions, which I have tried, but alas it doesn't seem to work :(

Does anyone have any experience with this?
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Wordpress W3 Total Cache

Post by bad_brain »

I had a similar problem (pagination not working and returning 404) which drove me nuts, and no fix to find on the net...just loads of people with the same problem.
I am 99% sure it's the same reason:

check the vhost container for the site and enable all options, per default it looks like

Code: Select all

Options +ExecCGI MultiViews -Indexes
change that to

Code: Select all

Options All
and see if it works, then you can narrow down the problem by adding options one by one.

:wink:
Image

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Wordpress W3 Total Cache

Post by bad_brain »

P.S. depending on what module you use you will should enable all options for both the directory AND the wrapper (when using fcgi for example) in the container....simply because I don't remember for which one it applied in the end... :lol:
Image

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Wordpress W3 Total Cache

Post by ayu »

hmm, I forgot to mention that I am using nginx (Apache seems to be very slow on the Raspberry PI).
Guess I could try and convert the .htaccess options to nginx ^^

Thanks b_b, I'll dig some more :D
"The best place to hide a tree, is in a forest"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Wordpress W3 Total Cache

Post by ayu »

ah sorry ... I'm so stupid ^^
Because I didn't think about that I was using Nginx, I forgot to look for nginx-specific answers.

This solved it

Code: Select all

try_files $uri $uri/ /index.php;
Sorry for wasting your time buddy, and thanks for the replies! :)
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Wordpress W3 Total Cache

Post by bad_brain »

no problem, good you made it work...:D
Image

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Wordpress W3 Total Cache

Post by ayu »

Another thing I noticed now, is that only the front page seems to be cached (all other pages are slow)

Front page

Code: Select all

http://blog.alcor.se
Random post

Code: Select all

http://blog.alcor.se/index.php/2013/06/02/sin-4-5-some-important-changes/
Any experience with this b_b (or anyone else for that matter)?

I'm considering installing varnish later as well, to try and boost it.
But I have never needed to cache so much before like this, so I don't have that much experience with it.
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Wordpress W3 Total Cache

Post by bad_brain »

hm, I never had a reason to run a cache on website level, so I don't have really much experience with that... :?
have you checked/optimized your mysql config though? I mean, the site is not that extensive that I could see a reason for a cache at all, so the bottleneck seems to be on the server level... :-k

a really good script I can recommend is the tuning-primer for mysql (should work for mariadb too in case you are using that one):
https://launchpad.net/mysql-tuning-primer" onclick="window.open(this.href);return false;
Image

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Wordpress W3 Total Cache

Post by ayu »

Well the bottleneck is the PHP processing.
The Raspberry PI is extremely slow when it comes to that, so I think optimizing that will be a bit hard :o

But I will have a look at the optimizer script for the db!
Thanks! :)
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Wordpress W3 Total Cache

Post by bad_brain »

hm, I don't know your nginx config, but I am sure you can fiddle around with that one too to get some better performance (gzip compression, using the inbuilt caching features).
varnish might be not exactly the right solution I think, because it's more for sites that suffer from performance problems because of heavy hits and heavy db activity (because of the amount of content being pulled from the db), and not really for PHP caching in general....what about APC? I made some good experience with it on s-o v1 when it was on its first tiny vserver and it works with nginx too.
Image

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1624
Joined: 28 Aug 2005, 16:00
18

Re: Wordpress W3 Total Cache

Post by maboroshi »

I did a bit of research in to this before.

and from what I read they suggest using nginx to serve static files and apache as dynamic content handling like PHP etc :D

As apache has a lot of optimizing abilities and nginx is very fast at serving content :-)

Don't quote me on this, I am going by pure memory :D

Anyway

Post Reply