Live data from Hacker News

HTTP/2 Server Push on Netlify

netlify.com

11–20 of 24 posts

Re: HTTP/2 Server Push on Netlify

#11
post #10
post #6

Earlier quoted context omitted.

If you can write a tag that references app.ab9a9a09fe9.js, presumably you can write a HTTP header that references that same file, no?

What about a static website served through nginx, for example?

I'm actually just doing that right now (changing my static website to work with Netlify's Push). Presumably, your base HTML looks something like this:

  
Then, your _headers.j2 file should look like this:

  /*
    Link: ; rel=preload; as=stylesheet
Which will just be replaced with the correct value, same as in your HTML template.

Re: HTTP/2 Server Push on Netlify

#14
post #6
post #4

How do people go about sending Link headers / configuring server push for resources with a changing hash in their filenames? For example if you have your app.ab9a9a09fe9.js file, but then the next deploy you have your app.ba293dcde.js file... can you just set the resource to app.*.js somehow?

If you can write a tag that references app.ab9a9a09fe9.js, presumably you can write a HTTP header that references that same file, no?

For example: a SPA webpack setup using html-webpack-plugin which generates the tags in index.html for the different assets, later served by nginx or similar.

How does one tell nginx the names of the files to push if they are generated dynamically? You have to put the names in a separate file and then somehow configure the server using that file?

Re: HTTP/2 Server Push on Netlify

#16

This is welcome, but doesn't seem to be ready. My site broke with SPDY errors (wth?) when I enabled this.

Hey StavrosK, don't hesitate to reach out to Netlify support. I'd love to take a look at your site to figure out what's going on there.

Yep, I already talked to Chris about it, thanks! I talked to you guys a week ago about HTTP/2 Push, I didn't know you'd have it ready so soon. I'm eager to get this working on stavros.io, so please feel free to email me so we can debug this!

Re: HTTP/2 Server Push on Netlify

#18

Earlier quoted context omitted.

Hey StavrosK, don't hesitate to reach out to Netlify support. I'd love to take a look at your site to figure out what's going on there.

Yep, I already talked to Chris about it, thanks! I talked to you guys a week ago about HTTP/2 Push, I didn't know you'd have it ready so soon. I'm eager to get this working on stavros.io, so please feel free to email me so we can debug this!

I just deployed a change that we think it should fix the problem in your site, we're going to keep an eye on it \o/

Re: HTTP/2 Server Push on Netlify

#19
post #4

How do people go about sending Link headers / configuring server push for resources with a changing hash in their filenames? For example if you have your app.ab9a9a09fe9.js file, but then the next deploy you have your app.ba293dcde.js file... can you just set the resource to app.*.js somehow?

I suppose you are using webpack, i have just written a small plugin for this (assumes an SPA, writes the same js/css to /*): https://gist.github.com/Kamshak/35630ec21df8dca27de3bb915f2d...

Re: HTTP/2 Server Push on Netlify

#20
post #6
post #4

How do people go about sending Link headers / configuring server push for resources with a changing hash in their filenames? For example if you have your app.ab9a9a09fe9.js file, but then the next deploy you have your app.ba293dcde.js file... can you just set the resource to app.*.js somehow?

If you can write a tag that references app.ab9a9a09fe9.js, presumably you can write a HTTP header that references that same file, no?

this webpack plugin might help you: https://gist.github.com/Kamshak/35630ec21df8dca27de3bb915f2d...

I have no idea why the original comment by the author is shadow banned.

Post reply on HN