Bill Bensing
Bill Bensing

Reputation: 193

NGINX HTTP2 Push - Angular

We have an Angular app which hashes assets as part of the build output (e.g. runtime.e44ca0c6491d9325714a.js ). The hash is necessary given frequent app updates. The app is hosted on an NGINX server and we want to enable http2 push for these assets.

Is there a way to do "fuzzy" http2_push?

For example, we want to do something like:

 http2_push runtime.**.js;
 http2_push polyfills.**.js;

Where can I find info on achieving this outcome?

Upvotes: 1

Views: 1404

Answers (1)

RidgeA
RidgeA

Reputation: 1546

No, you can't do like this. Moreover, I'd recommend you to use http2 server push for static data with care. It would be better (from a performance point of view) to use browser's caсh than server push.

Read this - https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/edit#heading=h.ke8t5vjw3jh4

You may take a look at this package - https://github.com/google/node-fastify-auto-push how the author implement server push and how the code makes a decision to push resource or not.

Upvotes: 3

Related Questions