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

Bookmark & Share

Related Posts

About the Author

author photo

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 7 News.

See All Posts by This Author

There Are 13 Responses So Far. »

Pages: [2] 1 » Show All

  1. #13

    [...] 5. Install APC - Quoting Connectedinternet…. [...]

  2. #12

    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

  3. #11

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

Pages: [2] 1 » Show All

Subscribe without commenting

Post a Response


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.