Make the pushing of JS optional

Created on 25 March 2023, over 1 year ago
Updated 31 October 2023, about 1 year ago

Problem/Motivation

This module pushes all local CSS and JS. This issue is about the JS only.

If you are interested in the CSS part, see: #2983497: Let the http2_server_push module take critical_css's critical CSS and push only that?

There a few reasons to not push all the JS:

  • JS is not render blocking
  • It defeats the use of deferring JS in the HTML
  • It has bandwidth and CPU contention for non-important JS which can safely be deferred.

Examples of non-important JS that should not be pushed are any JS that does not have anything to do with the initial viewport. If not pushed, this will give the browser more time to do more important tasks relating to rendering the initial viewport.

I think it will be a great feature to allow admins to push all the JS or not.

Proposed resolution

There are a few options:

  1. To keep this module configuration-less, you can push only the JS in the head as defined in libraries
  2. Allow an admin setting to push JS or not
Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇹🇹Trinidad and Tobago xamount

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024