• Resolved Gal Baras

    (@galbaras)


    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 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 to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 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

    (@galbaras)

    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 1 year, 10 months ago by Gal Baras.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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

    (@galbaras)

    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

    (@optimizingmatters)

    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.