Ultimate Wordpress Site Speed – Install WP-Cache2 AND APC At The Same Time


I’ve just tweaked my server and finally managed to get WP-Cache2 AND APC (Alternative PHP Cache) to work together at the same time on my WordPress blog. The difference this has made to my page loading speeds is absolutely amazing, and it’s only going to get better as the cache increases in size. For those of you who are regular readers you will notice straight away how much faster my pages are, despite the number of plugins I now have installed. The only thing slowing my pages down now, is the time it takes to pull in the external ads etc.

Most Wordpress users are familar with WP-Cache2, but fewer are familiar with APC. WP-Cache2 stores the HTML of a page for a user-defined period, which can cause problems if new comments or posts are made within this period i.e. if the page changes.

APC doesn’t suffer from this problem, as it speeds up loading times by caching compiled WordPress PHP files so that the loading time the next time a page is loaded, is much faster regardless of whether the page has changed.

Getting both caches to work together used to be impossible, but if you follow the steps below then you too can have fast loading pages that benefit from both types of caching, reducing your server straing and potentially saving you cash in the long run.

1. Install (Alternative PHP Cache) PC on your server

Installing APC is a doddle, if you know your way around your server. If you’re not comfortable doing this yourself, Matthew will do it for around £30. If you already have WP-Cache2 running I’d disable it until Stage 3.

Download: APC

2. Tweak APC configuration

This is the clever bit that Mark Jaquith came up with, which is actually quite simple in the end. To get APC to work with WP-Cache2 make the following changes:

In php.ini in the [apc] section, set ‘apc.filters = wp-cache-config’ to exclude wp-cache-config.php and wp-cache-config-sample.php from being cached by APC

3. Install WP-Cache2

If you haven’t already done this, then download the plugin here and upload it to your server. Then activate it and configure it on the Options page.

Hope you found this useful and that this guide worked for you as well. Don’t forget to let me know how you get on and whether these tweaks helped to keep your site alive the next time you get ‘Dugg’!

Read more about APC, Wordpress and Caches: Asymptomatic

Related Posts

Filed Under: Tools & Tips

Tags:

Bookmark & Share

About the Author: Everton is based in London and has worked in the internet and mobile space for over ten years now, and before that worked in corporate strategy and consulting. He has a degree in Economics from Cambridge University, and currently runs the Portal and online operations for one of the largest ISPs in the UK. He also writes for Windows 8 News, Windows 8 News and One Tip A Day.

RSSComments (8)

Leave a Reply | Trackback URL

  1. mod says:

    Next time you get “dugg”

  2. Matthew says:

    Yeah, it is noticeably faster isn’t it. Actually on this server it wasn’t entirely straightforward to install APC, since I had to compile from source… on Debian, Ubuntu, and other apt-based distros it’s much easier. Glad to be able to help :-)

  3. Paul Menard says:

    Awesome. I just migrated a site and have been beating my head against a wall trying to figure out why WP-Cache craps out when I enable it on a new server running APC. Rock!

  4. Everton says:

    Did it work Paul? Also look at this fix if you use WP-Cache with sk2

  5. Ashish Mohta says:

    APC is pretty cool.Bu ti am not sure how to use it.Should i ask my hosting or anybody can do it.

  6. Everton says:

    if you ask your host nicely they will probably install it for you

  7. Ahmed Bilal says:

    Ya know, a more detailed tutorial will get you a big digg on this :)

  8. Quix0r says:

    I had this problem here:

    # pecl install apc
    downloading APC-3.0.14.tgz …
    Starting to download APC-3.0.14.tgz (108,511 bytes)
    …………………….done: 108,511 bytes
    40 source files, building
    running: phpize
    Configuring for:
    PHP Api Version: 20041225
    Zend Module Api No: 20060613
    Zend Extension Api No: 220060519
    ERROR: `phpize’ failed

    Well, I have solved it and just want to show it to you: (you may need to alter some paths!)


    cd /tmp/pear/cache/APC-3.0.14/
    ./configure --with-apxs # (please read the INSTALL file why I use this here)
    make all install

    Now you need to add some entries as described in the INSTALL file to your php.ini(s).

    Greetings,
    Q

Trackbacks/Pingbacks

  1. 我爱wordpress » 四个没必要安装的wordpress插件
  2. How To Fix WP-Cache And Spam Karma 2 (SK2) Issues » Connected Internet
  3. How To Fix WP-Cache And Spam Karma 2 (SK2) Issues | Connected Internet
  4. Optimise Your CSS File | Connected Internet
  5. The Stumble Effect & How to Digg/Stumble Proof Your Site Version 2.0 | Anthony Jude Lawrence Dot Com
  6. Brève Wordpress: 40 liens, thèmes, plugins et astuces en tout genre !
  7. 34 tutoriels sur WordPress (astuces, hacks...) | Jean-Baptiste - Blog perso, Actualités, High-Tech, WordPress, Webdesign

Subscribe without commenting

Leave a Reply

CommentLuv Enabled
Comment Policy: Any comments are permitted only because the site owner is letting you post, and any comments could be removed for any reason at the absolute discretion of the site owner.