1. Home
  2. CGI & Passenger
  3. Passenger-backed apps perform unscripted optimizations

Passenger-backed apps perform unscripted optimizations

Overview

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:

<head>
<script src="http//kb.apnscp.com//test.js""></script>
<!-- rest of head -->

becomes:

<head>
<script>//<![CDATA[
console.log("Hello 212a.");
//]]>
</script>
 <!-- rest of head -->

Cause

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.

Solution

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.

Updated on July 8, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help! If you get an error, visit https://lithiumhosting.com/support instead.
Contact Support