Minify JS Issue
-
https://website.name/local_ga_js=2fa6dbffb7810e261172a62049d78fed
When running a SEO test, it says “local_ga_js=2fa6dbffb7810e261172a62049d78fed” needs to be minified. How can i do that?
-
as local_ga_js is not a static file but a PHP script that returns the local GA JS, AO is not able to minify that Nico. maybe check with the developer of the plugin that is responsible for local serving of that JS and ask if they can minify it?
hope this clarifies,
frankHey Frank thanks for your reply,
how can i find whos the developer for local serving for that js? Im kinda new to this all.
-
This reply was modified 2 years, 3 months ago by
nico121.
well, you’re likely using a plugin to locally cache the GA JS, so it would be the developer of that plugin?
Okay so i fixed that, the only issue i have is this now, how can i fix that? I enabled all minify options on JS and CSS but its still 2 more than recommended.
well, you _could_ try to aggregate JS & CSS, these are off by default as with HTTP/2 (which 99.9% of sites are on) combining is not always the best strategy so the recommendation in your screenshot is not necessarily correct these days. but try aggregating JS and/or CSS out (assuming those are not on yet) and test if performance indeed is better (using e.g. webpagetest.org or Google’s Pagespeed Insights) ? 🙂
Hey again, so i have no more issues so far on the tracking plugin. But when i run the google page speed test it gives me a few red warnings for auto optimize although i have minified css and js:
“…css/autoptimize_cffef56….css”
“…css/autoptimize_single_567a2bb….css?ver=170…”
“…js/autoptimize_f3a8e35….js”
“/css?family=…”
How can i further optimize that so it wont give me the red warnings?-
This reply was modified 2 years, 3 months ago by
nico121.
depends on what the actual warnings are, can you specify?
These 3 warnings show all the css and js issues i mentioned earlier:
ok, so for render-blocking CSS have a look at the “eliminate render-blocking CSS” option, but do take into account you’ll have to either;
a) generate & copy/paste the “above the fold CSS” in the field below (more info in the AO FAQ, look for “inline & defer CSS”) OR
b) create manual rules on the “critical CSS” tab (generating critical css for each rule) OR
c) take a subscription over at criticalcss and paste your API in the field on the critical CSS tabre. unused code (JS or CSS); AO has no way of knowing what is or what is not used so it cannot remove that. There however is a a premium service that can remove unused CSS (but not JS) that could help. For more info see the Rapidload entry on Autoptimize’s “Optimize More” tab.
hope this helps,
frankAnother issue i just faced. Once i open the website on my phone, it won’t display the website correctly, however when i’m logged into the site as admin, everything shows correctly. (When i turn off auto optimize it shows everything too)
How can i fix that
you’ll have to do some basic troubleshooting here; try to identify what is breaking things by just disabling CSS or JS or HTML or Image optimization (incl. lazyload). Based on that we can see what the next steps need to be 🙂
frank
I just unchecked and checked it again, clicked on save and clear cache and now it works. So it might be the cache that won’t display it?
hard to say, but if this happens again;
1. describe what specifically is wrong
1. make a screenshot and share it
1. check the browser console for possible JavaScript errosI fixed it, it was load JS early. Now it works again i had to uncheck it. Does this slow down my page now?
is that “force JS in head”? if so; that option is strongly discouraged, it makes the site slower actually and is only useful in very specific situations really.
-
This reply was modified 2 years, 3 months ago by
The topic ‘Minify JS Issue’ is closed to new replies.