Finally got WP-Super-Cache to Work!

I’ve finally sorted out why I couldn’t get WP Super Cache working…

For those that don’t know, the WordPress plugin is designed to deliver straight html pages to the client browser, zipped if the host will do it.  This makes page loads a lot quicker for the user – which is good! Normally, all pages are dynamically created on the fly for each client visit.  The database driven method of page generation is good for maintenance, but is a bit slow for the user, so I was interested in increasing usability, naturally.

Previously, I’d tried the thing and always gave up.  This time I battled through and the answer was right at the very bottom of the FAQs!

The key, for me, was to look at the page source, and right at the bottom I found:

<!– Page not cached by WP Super Cache. Could not get mutex lock. –>

Whacking this into a popular search engine led me to the bottom of the plugin’s FAQs, here, which is item 13 (unlucky for some) but isn’t explicitly defined.  All I did was to look for the line:

“$useflock = true”   in wp-content/wp-cache-config.php

Unfortunately, the syntax/wording is slightly different in the latest version.  But the principal is the same.  This is the current line:

$use_flock = true; // Set it true or false if you know what to use

I uncommented and left it at true, as it worked, which is all I was after.  Now I’ve started implementation on some of my more popular sites.  They seem to be a bit snippier and zipping is working on my (cheap) host.  This was especially important on Crawling Chaos because of the media files that also have to be delivered concurrently with my verbose content.

Comments

9 responses to “Finally got WP-Super-Cache to Work!”

  1. micheal.smith898 avatar
    micheal.smith898

    For those that don’t know, the WordPress plugin is designed to deliver straight html pages to the client browser, zipped if the host will do it. Websites are always helpful in one way or the other, anyways, a good way to get started to renovate your dreams into the world of reality. This makes page loads a lot quicker for the user – which is good! Normally, all pages are dynamically created on the fly for each client visit. The database driven method of page generation is good for maintenance, but is a bit slow.

    Thanks

    Micheal,

  2. rebus avatar
    rebus

    For me – changing $sem_id value worked.

    1. Strangely avatar

      How do you mean, rebus? Where does that go?

  3. Strangely avatar

    TIM.
    If you still can’t get it to completely work, I recently read that you can use htaccess to do the caching for you.. You do it on a filetype basis if I recall, like jpg etc. I don’t know how well this would fit in with WordPress though. Maybe if you’ve fixed html pages as part of your website these could be cached in this way, mimicking what wp-cache is doing.
    This page https://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html may give you some pointers. The whole of https://www.askapache.com/ is extremely helpful, well laid-out, detailed and readable. There are a host of external links to other related stuff.

    Rees

  4. The IceMan avatar

    i think is’t the PHP safemode limition

    thank

  5. Strangely avatar

    The forums are the best place. They’ll prompt you in various ways even if the solution isn’t right there.
    If I recall, if it half-works, like you say, then that’s usually a hosting limitation, the same as the ability to serve gzipped pages.
    I found that you need

    • the folder permissions spot on
    • the bit of code in wp-config spot on
    • the bit of code in htaccess spot on

    If they are right then it should at least half-work!
    Rees

  6. The IceMan avatar

    i solved half of the problem.
    i can only cache only to the cache folder and not to the supercache

    i opened a help request on wordpress forums waiting for more help in the mater….

    thanks 🙂
    TIM

  7. Strangely avatar

    Hi Ice Man.
    I can’t recommend anything else, sorry. Usually, if something works then that’s all I need. Since I originally got the thing to work, there have been several updates to the plugin that have improved it quite a bit. I now have it running on all the WordPress installs I’m responsible for.
    Have you had trouble with it? The last update was this week…;-)

  8. TIM avatar

    not working for … 🙁
    any thing else you can recommend?

Leave a Reply to The IceMan Cancel reply

Copyright ©1976

All Rights Reserved by Strangely Perfect

Occasional Tweets here @crawlingchaosuk