WP Super Cache Developer Documentation

I’ve finally found the time to write up some documentation for developers who want to work with WP Super Cache.

It’s a work in progress but should help other plugin developers who want to interact with the cache.

Suggestions and comments welcome.

PS. If you’re in Cork on November 14th, head along to BarCamp Cork III. I’ll be giving a talk, “How WP Super Cache Works”. It’ll be less technical than this but I’ll answer questions too. Check out the other sessions too.

10 thoughts on “WP Super Cache Developer Documentation

  1. Good! This is exactly what I needed.

    Now Autoptimize will interact better with WP Super Cache 🙂

    By the way, when will wp_cache_clear_cache() be available?

    1. In the next version. I need to sort out a few gettext problems and sync with a few people who volunteered to translate. Maybe end of the week.

  2. Just wanted to thank you for your advice and the documentation. It’s great and will be really helpful in the future. My cookie-plugin, btw, works fine now 🙂 Thanks again!

  3. Feedback requested, feedback provided. 🙂

    1. “The plugin folder normally lives in wp-super-cache/plugins/ but by modifying the $wp_cache_plugins_dir variable in the config file you can put it anywhere. That’s a good idea if you develop your own supercache plugins …” That’s fine and dandy – until another SC plugin comes in and sets $wp_cache_plugins_dir for itself.

    2. Please elaborate on the four filters wp_cache_key,
    wp_cache_served_cache_file, wp_cache_get_cookies_values and do_createsupercache, such as possible secondary usages. Three common examples:

    a. running my own PHP on before serving half-on requests without editing wp-cache-phase1.php myself.
    b. force serving a fresh page if the http referer is a search engine result page.
    c. force expiring the cache for a page because of a querystring parameter.

    I call them ‘secondary usage’ because filters aren’t supposed to have side effects. Go figure.

    Sorry to bust your chops, Donncha, ye know those two sample plugins? Both absolutely aint got no inline documentation — not even one line of comment! Aint much help if your doc tells a padawan to use ’em as a reference.

    Thanks for posting this.

    1. Thanks William!

      $wp_cache_plugins_dir is set in your config file which isn’t updated when you upgrade the plugin so no need to worry about that.

      I’ll see about adding more examples, and comments to the plugins. Glad you found the docs useful.

      1. After reading through the docs I was struck a few times by ambiguity caused by your use of ‘config file’ and ‘configuration file’. I think William’s confusion is because its not clear if you mean wp-config.php or wp-cache-config.php, which is an important difference (unless it could be either, in which case that’s relevant too). If you changed uses of ‘config file’ to be the actual filename it would probably clear up several sections.

      2. Also, it would be great if there was a link to the documentation article from the main WP Super Cache page and from the readme.txt description, I tried to find it again and couldn’t except for this post.


Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.