I am trying to defer my javascript loading according to Google's pagespeed analysis of my site. However they are complaining about the following:
http://www.example.com/pagespeed_static/js_defer.pbrP1whUgE.js
which is the code that is automatically generated by them. How can I defer this to load at the end?
In my pagespeed.conf file I have the following set:
ModPagespeedEnableFilters defer_javascript
On an additional note, has anyone else noticed that Google Chrome's audit's complain about using adsense and recommend optimizing no optimizable code?
I'm not completly sure but I think that to enable
defer_javascript
you have to change theRewriteLevel
toPassThrough
and manually enable the filters you want (this will override theCoreFilters
that are enabled by default).An example from the official site:
Apache:
Nginx: