---
title: "Passenger-backed apps perform unscripted optimizations"
date: "2016-02-17"
category: "cgi-passenger"
slug: "passenger-backed-apps-perform-unscripted-optimizations"
---

## Overview

[[passenger-supported-apps]] (Node, Python, Ruby, and Meteor) may have their JavaScript, CSS, and image assets automatically optimized without any explicit configuration in your application code.

For example, a small external JavaScript file may be inlined after the first request:

<head>
<script src="//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-support]] and Passenger. PageSpeed performs [automatic optimizations](https://developers.google.com/speed/pagespeed/module/config_filters), including inlining external resources from the same domain when the inline cost is lower than an additional HTTP request.

## Solution

Disable PageSpeed by following [[disabling-pagespeed]]. The directive must be placed in the [[where-is-site-content-served-from]] for your site, since Passenger-backed applications do not recursively inherit `.htaccess` rules from parent directories.
