[Plugin: WP Super Cache] Caching interferes with More Fields plugin
-
I use the “More Fields” plugin, which lets me add a “File List” Custom Field to my Add/Edit Post pages. The “File List” control works by issuing an AJAX request to “/wp-content/plugins/more-fields/more-fields-write-js.php?post_id=xxx&…”, but that request fails when WP Super Cache is enabled — even when I explicitly add “more-fields-write-js\.php” to list of strings not to be cached.
Here’s why: at the time the AJAX request is made, I have to be logged in, and the effect of being logged in causes WP Super Cache to append the string
<!-- WP Super Cache did not cache this page because you are logged in and "Don't cache pages for logged in users" is enabled. -->to the AJAX result, which effectively mangles the JSON string being returned.My solution was to rearrange a couple of tests being performed in wp-cache-phase2.php, so that it FIRST checks
if (!in_array($script, $cache_acceptable_files) && wp_cache_is_rejected($wp_cache_request_uri))BEFORE it checksif ( $wp_cache_not_logged_in && is_user_logged_in() && !is_feed() && !is_admin() )This simple change insures that anything I explicitly block from being cached won’t be modified either. It allows “More Fields” to work properly, and it allows me to easily fix any other incompatible plugins that I might run into.
Perhaps this change will someday make its way into WP Super Cache….
The topic ‘[Plugin: WP Super Cache] Caching interferes with More Fields plugin’ is closed to new replies.