Comment #2 on issue 1034 by
jmaes...@google.com: After Ajax callback, the
I assume you're serving the AJAX data with an HTML or XHTML content type.
It looks like the add_head filter is enabled for the AJAX data you're
fetching. add_head is turned on by a number of other pagespeed filters
that assume they're working with a fully-formed html page rather than a
fragment of page content (which is what I suspect your AJAX fetch looks
like on the server side).
The simplest expedient is to turn off pagespeed for content you are
fetching using AJAX.
More complicated is to selectively enable a small subset of pagespeed
filters for this content (for example, you might permit image rewriting if
the content contains embedded <img> tags). But in general you're going to
want to avoid any filter that moves content around on the page or injects
JavaScript.