Title: [Plugin: WP Super Cache] editor cannot update cached page
Last modified: August 20, 2016

---

# [Plugin: WP Super Cache] editor cannot update cached page

 *  Resolved [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/)
 * As admin, I can edit a page and save changes and it goes up immediately. My editors
   cannot. They also do not see the button in the header to delete cache, so it 
   cannot even be manually forced. In my opinion, there should be a capability that
   could be managed through Capabilities Manager that would allow admins to turn
   this on and off for their users.
 * I know it’s probably not a bug, so please consider a feature request.
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679096)
 * I turned on debugging. It logs a lot more actions when the admin does it than
   when an editor does it, however the debugging seems to suggest that it is trying
   to delete the cache when the edit makes a change, and I can’t figure out where
   it’s doing permission checks in the code.
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679099)
 * I’m seeing some funny business in the supercache dir output … that includes both
   path AND a URL to a _revision_ of the post, rather than the permalink to it (
   I put in {removed} to hide actual paths):
 *     ```
       18:48:12 /wp-admin/post.php Clearing cache for post 14239 on post edit.
       18:48:12 /wp-admin/post.php supercache dir: {removed}/wp-content/cache/supercache/tunxis.eduhttp:/tunxis.edu/93-revision-4/&post_type=revision&preview=1/
       ```
   
 * I think that should look like
 *     ```
       18:48:12 /wp-admin/post.php Clearing cache for post 14239 on post edit.
       18:48:12 /wp-admin/post.php supercache dir: {removed}/wp-content/cache/supercache/tunxis.edu/college-information/graduation/faq/
       ```
   
 * Other potentially helpful bits of info:
    - edit url is [https://tunxis.edu/wp-admin/post.php?post=93&action=edit](https://tunxis.edu/wp-admin/post.php?post=93&action=edit)
    - i notice that the `get_current_url_supercache_dir` function has some logic
      so that if no post_id is passed in, it runs `$uri = strtolower( $wp_cache_request_uri);`…
      this WOULD be happening in this case because `wp_cache_post_change` is running
      this code: `if( $super_cache_enabled ) {
       $dir = get_supercache_dir();`
 * I feel like that last part is wrong. I feel like $post_id should get passed to`
   get_current_url_supercache_dir` because it IS known at the time the code is run
   in `wp_cache_post_change`. I’m going to see what happens if I pass $post_id.
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679101)
 * I just noticed that a little while later in the log, I do have some entries that
   look more promising but still don’t hit the mark:
    `{removed}/wp-content/cache/
   supercache/tunxis.eduhttp:/tunxis.edu/college-information/graduation/faq/`
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679115)
 * This sucks. I’m trying to switch checks from using wp_supercache_admin() to using
   2 custom capabilities I created, but unfortunately, everything currently routes
   through options-general.php, including the action to delete the page cache, which
   means you always need manage_options capability, so I wind up with ‘You do not
   have sufficient permissions to access this page’ if the user is an editor.
 * I don’t know a lot about plugin development and routing shit through different
   files so the built-in permission checks don’t fire, and I don’t know if I should
   be trying to circumvent it, but I have a feeling I’m going to learn.
 * Seems to me that deleting the page cache should be one capability check on top
   of the edit_post capability. So maybe the page cache delete thing should be hooked
   onto edit page/post.
 * idk.
 * goddammit.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679137)
 * Hi, can you try the development version as it fixed a number of bugs in 1.0?
 * [http://downloads.wordpress.org/plugin/wp-super-cache.zip](http://downloads.wordpress.org/plugin/wp-super-cache.zip)
 * I’ll hopefully get a chance to look at this over the weekend.
 * Donncha
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679141)
 * Editor still cannot update the cached version of a page.
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679160)
 * I’ve created a replacement of wp-cache.php. This is a modification to the dev
   version, so it should be fairly easy to merge into the development branch. [http://pastebin.com/gBznjQZk](http://pastebin.com/gBznjQZk)
 * This version replaces using `wpsupercache_site_admin()` with checks for capabilities
   on the current user/role. I added 2 capabilities: `wpsupercache_manage_options`
   and `wpsupercache_delete_page_cache`. I assign both capabilities to roles with`
   manage_options` caps and `wpsupercache_delete_page_cache` to roles with `edit_pages`
   caps. One could install the Capability Manager plugin to modify the default permissions.
   Capabilities are added upon activation and removed upon deactivation.
 * Let me know if you need further explanation of anything.
 * This probably breaks compatibility with older version of wordpress because I 
   assume the existence of the `current_user_can` function.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: WP Super Cache] editor cannot update cached page’ is closed 
to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [delete cache](https://wordpress.org/support/topic-tag/delete-cache/)
 * [editor](https://wordpress.org/support/topic-tag/editor/)

 * 7 replies
 * 2 participants
 * Last reply from: [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-editor-cannot-update-cached-page/#post-2679160)
 * Status: resolved