Passenger-backed apps perform unscripted optimizations


Applications launched through Passenger, which includes Node, Python, Ruby, and Meteor, may receive optimizations to JavaScript, CSS, and image assets which are not explicitly defined within application logic.

Take for example a small external JavaScript asset that may become inlined after the first request:

<script src="//test.js""></script>
<!-- rest of head -->


console.log("Hello 212a.");
 <!-- rest of head -->


This is caused by an interaction between Pagespeed and Passenger. Pagespeed attempts to optimize inefficient layouts by performing a litany of optimizations, including inlining external requests that reside on the same domain if the embedded cost is less than the cost of making a subsequent HTTP request to fetch the asset.


Disable Pagespeed (see KB: Disabling PageSpeed) by locating the rule within the document root for the site. Note that Passenger-backed apps do not recursively inherit .htaccess rules as would be the case if the application were not managed by Passenger.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.