Restricting PageSpeed from rewriting URLs of introspective JavaScript

Restricting and Controlling PageSpeed optimization rewriting

Filters that change URLs of JavaScript files are at times incompatible with JavaScript code that does string-manipulation on its own URL. To avoid problems with introspective JavaScript files, PageSpeed can be configured to skip URL-rewriting for such files. PageSpeed uses simple heuristics to determine whether a JavaScript file is introspective.

This affects filters rewrite_javascript, combine_javascript, inline_javascript, extend_cache, and extend_cache_scripts.

This feature is on by default, but for many sites these heuristics are too conservative and prevent optimizations that would actually be safe. To turn it off:

pagespeed AvoidRenamingIntrospectiveJavascript off

This directive can be used in location-specific configuration sections.