WordPress.org

Ready to get started?Download WordPress

Forums

Notes on writing plugins for wp-super-cache (3 posts)

  1. zappoman
    Member
    Posted 6 years ago #

    I am researching what it would take to start using wp-supercache. The system is impressive, and I look forward to using it.

    I installed the basic system and it seems to be working well, but I am looking for information on how to make the cache refresh for certain pages based on new content being available.

    So for example, If I have a page that is refreshed with new content multiple times throughout the day, I'd love to be able to see the cache get refreshed when there is no content available.

    Note: The example would be something like a global recent posts page. So in this case some action can occur elsewhere in the blog that causes the pages info to need to be updated.

    Is this something that can be done with a plugin to super-cache?
    Is there existing documentation for how to implement a plugin to handle this case?

    Thanks in advance!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Calling the function wp_cache_post_change($post_id) will invalidate the cache for a given post/page number.

    Look closer at the phase 2 file.

  3. zappoman
    Member
    Posted 6 years ago #

    Thanks, that is certainly a helpful reply for how to invalidate the cache for a particular post.

    My other question was more related to writing supercache plugins in general. I am looking for something that describes the intended usage model, etc... I didn't see anything specific on Donncha's site, but maybe I missed it. I see the references in the readme.txt that mentions the hooks and suggests looking at plugins/searchengine.php as an example... but I'm curious if there is a deeper explanation? Has anyone else written plugins for supercache.

    If the answer is "Nope, that's all the documentation" then that's fine, I'll figure it out. But if there's someplace with more examples it would be helpful.

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic