1. Startseite
  2. CGI & Passagier
  3. Von Passagieren unterstützte Apps führen nicht geskriptete Optimierungen durch

Von Passagieren unterstützte Apps führen nicht geskriptete Optimierungen durch

Übersicht

Applications launched through Passagier, 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="//test.js""></script>
<!-- rest of head -->

becomes:

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

Ursache

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.

Lösung

Disable Pagespeed (see KB: Deaktivieren von PageSpeed) by locating the rule within the Dokumentenstamm 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.

Aktualisiert am März 7, 2021

Verwandte Artikel