You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
amattie@gmail.com writes:
I believe defer_javascript should provide two Apache directives and perhaps an
element attribute to allow for more precise control. I'd like to be able to
exclude certain known external and inline scripts from being filtered. One key
example of where it'd be useful is with Typekit scripts where you want the
script to run before the page even begins rendering to prevent a
flash-of-switching-fonts issue that's disruptive to the UX. Another example
would be Google Analytics, where the script is run async but where it'd still
be nice to have it run on its own track to keep the bounce rate stat as
accurate as possible.
My thought is that the script attribute would look something like this:
<script src="//ga.com/analytics.js" data-mps-no-defer="true"></script>
The first Apache directives would look something like this, where the value is
a wildcard match against the script tag's src attr:
ModPagespeedNoDeferJsSrc *analytics*
The second Apache directive is useful to fix issues where the content returned
from the URL on the same server shouldn't be touched by defer_javascript.
There's a very long story behind this, but it's necessary to make some parts of
WordPress play nicely with this filter. I can research further and provide a
detailed write up in another email if someone wants to dig into it. Anyway, in
this directive, the value would be a wildcard match against the request URL:
ModPagespeedNoDeferJsReqUrl */upload*
Original issue reported on code.google.com by jmara...@google.com on 27 Jul 2012 at 9:53
The text was updated successfully, but these errors were encountered:
Note that one aspect of this is already released but not yet doc'd
(pagespeed_no_defer) but I left it in the bug description to keep the flow of
Andrew's comment.
Original comment by jmara...@google.com on 27 Jul 2012 at 9:54
Original issue reported on code.google.com by
jmara...@google.com
on 27 Jul 2012 at 9:53The text was updated successfully, but these errors were encountered: