Title: Cache not always cleared
Last modified: May 15, 2023

---

# Cache not always cleared

 *  Resolved [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/)
 * Divi site, if this makes any difference, with Static CSS Files disabled.
 * I have WP Fastest Cache configured to clear all of its caches whenever a plugin
   or theme is updated. I also have an action that runs `autoptimizeCache::clearall(
   false );` when this happens.
 * However, it seems like the AO cache isn’t being cleared properly, and I often
   get script errors after updates. Adding ?ao_noptimize=1 to the URL produces a
   clean page with no issues, so this must be related to combination/minification.
 * So I’ve been going to the site, clearing the Divi static file cache and then 
   AO and WPFC caches, but this hasn’t always worked.
 * [This thread](https://wordpress.org/support/topic/autoptimize-cache-might-not-have-been-purged-successfully/)
   gave me the idea that this might be due to the admin bar AJAX clearing not working
   properly, and reminded me that things seemed to work whenever I changed or disabled
   JS optimisation options and then simply reverted them, clearing the cache from
   the AO settings page.
 * I’m not seeing any error messages, but I suspect that the admin bar function 
   isn’t clearing the JS/CSS cache, and that triggering the action from WPFC isn’t
   working either.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcache-not-always-cleared%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16737350)
 * afraid I don’t have a direct answer, but;
    * the problems with the clear cache
   in the top menu are simply timeouts of the AJAX call and seem unrelated to what
   you’re describing * JS errors are unlikely to be solved by just clearing the 
   cache * [Autoptimize “listens” for the WP Fastest Cache wpfc_delete_cache action](https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeMain.php#L273-L296)
   and will clear it’s own cache when WPFC’s is cleared so you action should not
   be needed
 * questions:
    * what kind of updates are you referring to that trigger errors? 
   content or changes to the JS/ CSS or … ? * what JavaScript errors are those? *
   if you clear AO’s cache, do you see the number of files in there go down (there
   will always be files there as AO will try to “warm” the cache immediately)?
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16737640)
 * Updates are whatever plugins and/or theme changes are released, so their contents
   vary.
 * The script errors are typically unexpected symbols or end of file. The problem
   is they’re not there in the unminified page.
 * I’ve just tested updating a site, and the only file that changed its ID was `/
   js/autoptimize_single_UNIQUEID.js`, which was excluded from being combined. The
   combined CSS and JS IDs stayed the same.
 * I’ve tested clearing manually from the admin bar and the settings page, but the
   unique IDs don’t change afterwards. Are they supposed to?
 * I’ve removed the extra WPFC integration. Thank you for this.
    -  This reply was modified 3 years ago by [Gal Baras](https://wordpress.org/support/users/galbaras/).
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16737769)
 * the unique id’s only change when the contents of the unminified file changes (
   the id is a md5 hash of the content).
 * it is indeed not impossible that the extra WPFC integration caused this.
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16738530)
 * I can confirm (on another site) that AO cache is being cleared and recreated 
   when a plugin is updated.
 * Thank you, Frank. Always a pleasure.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16738694)
 * to be honest; I would not necessarily want to clear AO’s cache after a plugin
   update; if the plugin has new JS/ CSS, AO will “see” that (due to the md5 hash
   of the contents of the file) and will if needed create the new version with a
   new hash in the filename.
 * that being said; it does not hurt to clear the cache now and again, which is 
   what happens automatically that way 🙂

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

The topic ‘Cache not always cleared’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/cache-not-always-cleared/#post-16738694)
 * Status: resolved