WordPress.org

Ready to get started?Download WordPress

Forums

WP-Super Cache breaks TDO Mini Forms (4 posts)

  1. the_dead_one
    Member
    Posted 6 years ago #

    Is it possible for other plugins to tell WP-Super Cache not to cache specific pages?

    With my plugin TDO Mini Forms, it generates custom forms for users (and non-logged in users) to submit posts. However I've implemented a simple security feature that each time a form is generated it has a unique key in it. Of course if the page containing the form is cached, it caches the last key used and so breaks the security check.

    Is it possible for another plugin to tell wp-super-cache not to cache specific pages or is there another solution I could implement?

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Posted 6 years ago #

    You could add a regular expression to the "Rejected URIs" box to catch that page?

  3. the_dead_one
    Member
    Posted 6 years ago #

    Yes you could and I plan to put a section in the readme.txt for tdo-mini forms to explain that.

    However I was wondering if there was an automatic way I could do it within the code so that users don't have to worry about configure wp-super cache to work with tdo-mini forms.

  4. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Sure, look around line 533 of wp-cache.php. That's where the regular expression list is written out to the config file. You need to either:

    1. Check if the "wp_cache_replace_line" function exists and use that to add your regex.
    2. Write your own version of that function and do the same.

    Another option is to check if add_cacheaction() exists and use that to add a hook onto "add_cacheaction" to modify the list of rejected URIs, $cache_rejected_uri.

    Or you can put a section in your readme. :)

Topic Closed

This topic has been closed to new replies.

About this Topic