• Resolved kbowson

    (@kbowson)


    Hi Futta!

    First, I gotta say… I absolutely love AO. It’s an incredible plugin that, out of the box, speeds my site up a TON.

    My site was one of the ones that was building up a really big cache (it hit 13GB+ (all in JS)). When I deleted the cache, I started to have some issues.

    As the cache starts to rebuild, things start to break. It’s always the JS so I figured I would just run the CSS and HTML side of things but no dice. With just those two on, I would still lose javascript functionality. To test to ensure it was AO, I would clear my cache (w3 and CF) and then things would function properly again.

    Tried uninstalling and reinstalling. Tried deleting any traces of AO off of the root and reinstalling. No luck.

    Any ideas? I’m not currently running AO and now my site feels sooooo slow. Truly appreciate anything Futta.

    Kyle

    https://wordpress.org/plugins/autoptimize/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Well, if JS optimization is off and all caches are cleared, there will no reference to an autoptimized JS file in the HTML any more. If at that point your JS breaks, the problem _has_ to be elsewhere, really. You’re not running W3TC’s minify at the same time, are you?

    Anyway, best way to go forward would be to re-create the problem, at which point I’ll be happy to take a look (although I leave for holidays Friday, so not a lot of time to do so before those I’m afraid).

    Regarding the cache build-up; you could (should, really) either exclude the page- or request-specific JS from optimization or disable the aggregation of inline JS alltogether using the API (“autoptimize_js_include_inline”-filter, cfr. example in autoptimize_helper.php_example). That will greatly reduce the number of files in your cache.

    Kind regards,
    frank

    Thread Starter kbowson

    (@kbowson)

    Hey Frank,

    Thanks for the quick response. No I was letting AO handle all minification. I turned it off on W3 and CF. The site is mantellignce[.]com.

    I don’t want to interrupt your pre holiday planning but am happy to turn on AO now to re-create the problem. Just let me know what to do?

    With the cache build up.. I tried the third option of checking the “defunct” box which didn’t work so need to try one of those other two options.

    KRB

    Plugin Author Frank Goossens

    (@futtta)

    am happy to turn on AO now to re-create the problem. Just let me know what to do?

    I’m off to bed now, but will be back online in approx. 8h. At that poing we could maybe start with HTML & CSS optimization (so no JS just yet)?

    With the cache build up.. I tried the third option of checking the “defunct” box which didn’t work so need to try one of those other two options.

    yeah, “look only in head” is pretty useless and will be replaced by an option to enable/ disable aggregation of inline JS/CSS (instead of the API-call mentioned earlier). for the excluding page- or request-specific JS, have a look at the FAQ, it might help.

    frank

    Thread Starter kbowson

    (@kbowson)

    Alright. Thanks Frank. I’ll try to be on around then to turn on HTML and CSS.

    Took a quick look a the FAQ’s but will look more deeply tonight.

    Plugin Author Frank Goossens

    (@futtta)

    OK, ping me here when you’ve enabled HTML & CSS optimization πŸ™‚

    Thread Starter kbowson

    (@kbowson)

    Hey Frank. Sorry, I passed out early last night.

    I decided to turn off Rocket Loader so that wouldn’t be another variable in the equation. Thing seem to be a little better but the same problem comes up. As the cache builds certain JS starts to break. Of what I can see, my sticky menu at the top, my social share buttons and a plugin that applies css classes to widgets. These three weren’t working a minute ago, I cleared W3TC’s cache and everything works perfectly.

    Also, I accidentally turned on AO with JS. Let me know if I should turn it off (I just need to manually deleted AO’s cache before)? Things seem to start breaking after an hour or so of W3TC’s build up.

    Let me know what I need to do?

    KRB

    Plugin Author Frank Goossens

    (@futtta)

    Hiya Kyle;
    Seems like you disabled AO again? If you’re ready to re-enable, let’s indeed start with HTML & CSS only (as you wrote things went wrong there already)?

    Alternatively, if you have a development environment, we could do some testing there?

    kind regards,
    frank

    Thread Starter kbowson

    (@kbowson)

    Hey Frank,

    It was on but I just deactivated the plugin, deleted it, deleted all residual cache and reinstalled it with everything selected with the exception of JS (and no advanced options).

    KRB

    Plugin Author Frank Goossens

    (@futtta)

    OK, had a look, all seems to be OK now, right? Let’s wait (while I sleep just before midnight here) and see if a problem does pop up, ok?

    frank

    Thread Starter kbowson

    (@kbowson)

    Yes sir… everything looks good now. And thank you for doing this Frank.

    If nothing pops, maybe we turn JS back on?

    KRB

    Plugin Author Frank Goossens

    (@futtta)

    seems like everything continues to work fine?

    If nothing pops, maybe we turn JS back on?

    We could but we should also disable aggregation of inline JS to avoid any cache problem using the “autoptimize_js_include_inline”-filter, cfr. example in autoptimize_helper.php_example, but I’m afraid I won’t have time to follow up on this before the 12th as I leave on holiday tonight.

    frank

    Thread Starter kbowson

    (@kbowson)

    Hey Frank,

    I turned JS back on.. Honestly, less broke this time than before (maybe bc Rocket Loader was off), but a few things still broke (my Disqus comment system for example).

    No rush, but would love to tackle this when you’re back from your vacation…

    KRB

    Plugin Author Frank Goossens

    (@futtta)

    But those problems occurred immediately, not after some time as you described earlier in this thread?

    Regarding the things that do break; have a look at your browser’s error console and see what pops up, you might have to exclude some unrelated JS to avoid errors from that contaminating your other JS (disqus). You could also give the “try/catch” option a try. If you activated JS optimization you can ping me here, I’ll be happy to take a look.

    frank

    Thread Starter kbowson

    (@kbowson)

    They broke after a little bit of time. A little embarrassed that I didn’t see the “try/catch” option. I added “disqus” and it took care of the issue.

    As far as the cache building up, would you recommend this option:

    excluding JS-variables (or sometimes CSS-selectors) that change on a per page (or per pageload) basis. You can read how you can do that in this blogpost.

    It sounds like the next update will have a solution for cache build-up? If so, is there an ETA for the release? (sorry you probably hate that question) Just wondering if I should spend the time with the above solution or wait…

    Plugin Author Frank Goossens

    (@futtta)

    the next update will simply by default not aggregate inline CSS/ JS, and as the reason for cache buildups is 99% in inline JS, the problem will be solved. you can already have that working by using the API, adding e.g. this to your theme’s functions.php;

    add_filter('autoptimize_js_include_inline','krb_js_include_inline',10,1);
    function krb_js_include_inline() {
    	return false;
    	}

    AO 2.0 will probably be out … later this yeaf πŸ™‚

    frank

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Various JS not working after cache builds’ is closed to new replies.