That’s very weird pixeldynamo; AO never aggregates/ minifies external files. Are you 100% sure that file is moved to the aggregated JS-file?
frank
Both sets of strings from the js file match the jetpack script, I can’t find them anywhere else.
I can email samples or the entire files if useful.
just had a look at the HTML of your homepage, the stats-code is still in there:
<script type='text/javascript' src='//stats.wp.com/e-201513.js' async defer></script>
so that is no the issue, but I now indeed see that the inline stats-code is migrated to the autoptimized JS;
<script type='text/javascript'>
_stq = window._stq || [];
_stq.push([ 'view', {v:'ext',j:'1:3.4.1',blog:'60484059',post:'962',tz:'0'} ]);
_stq.push([ 'clickTrackerInit', '60484059', '962' ]);
</script>
and that indeed will result in an important amount of autoptimized JS-files. to avoid this, add “_stq” to the comma-seperated exclusion list. I’ll make sure this gets exluded by default in the next release.
frank
I’ve excluded _stq but still generating a lot of files, how many are reasonable to expect?
Depends on your context really (one could expect different page types to have different JS, so each page type could easily have it’s own autoptimized file). let’s say that anything below 100 js-files seems like normal behavior.
I’ve compared the HTML of 2 “features”-blogposts and at least those 2 refer to the same aggergated JS-file (http://3m6ok5roj7q1lfxor15yilh164s.wpengine.netdna-cdn.com/wp-content/cache/autoptimize/js/autoptimize_3bf91e48539bd79953692bae2cba6dac.js), so that’s a first indication there is reuse of the same file across different pages (blogposts).
frank
Up to 105 (JS) already in five hours of a total of 142 files.
well, try to find which pages don’t server the exact same JS-file, once you have identified that you can see what the differences between those are (cfr. the approach taken in this post from earlier today) and exclude accordingly.
alternatively you could disable inline JS from being aggregated, which will 99,99999% sure solve this in one swift swoop (but which will exclude all inline JS from being aggregated) by adding something like this in a plugin or a (child) theme’s functions.php;
add_filter('autoptimize_js_include_inline','pixeldynamo_ao_js_include_inline',10,1);
function pixeldynamo_ao_js_include_inline() {
return false;
}
frank
Up to 242 now, a big improvement on before but there’s obviously something we still need to identify.
ok, feel free to update this thread as you solve this.
frank