push-promise

http2: PUSH_PROMISE client-side stream state

余生颓废 提交于 2019-12-13 17:09:30
问题 The http2 spec says: A receiver MUST treat the receipt of a PUSH_PROMISE on a stream that is neither "open" nor "half-closed (local)" as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. However, an endpoint that has sent RST_STREAM on the associated stream MUST handle PUSH_PROMISE frames that might have been created before the RST_STREAM frame is received and processed. The spec also has this lifecycle diagram. My understanding is that in order for a client to receive a PUSH_PROMISE

.NET 4.6 HttpResponse.PushPromise methods to manage http/2 PUSH_PROMISE header

跟風遠走 提交于 2019-12-08 11:22:27
I am a bit confused about PUSH PROMISE http/2 header handling in .NET4.6 . When I look HttpResponse.PushPromise there are two overloads: One that accepts path to resource public void PushPromise(string path) - am assuming resource is then read and binary sent across to client. Second public void PushPromise(string path, string method, NameValueCollection headers) that accepts sting method and NameValueCollection headers which I am failing to understand. Why would I want to pass method (assuming HttpMethod like GET, POST, etc) and collection of headers inside PUSH PROMISE header? From reading

.NET 4.6 HttpResponse.PushPromise methods to manage http/2 PUSH_PROMISE header

谁说胖子不能爱 提交于 2019-12-08 07:16:31
问题 I am a bit confused about PUSH PROMISE http/2 header handling in .NET4.6 . When I look HttpResponse.PushPromise there are two overloads: One that accepts path to resource public void PushPromise(string path) - am assuming resource is then read and binary sent across to client. Second public void PushPromise(string path, string method, NameValueCollection headers) that accepts sting method and NameValueCollection headers which I am failing to understand. Why would I want to pass method

ASP.Net HTTP2 PushPromise is slow

女生的网名这么多〃 提交于 2019-12-07 13:45:02
问题 I'm trying to implement the Http2 push server functionality using "PushPromise" .NET 4.6.1, for this I have a "html extension" with Razor (we did not implement MVC only used the Razor engine to build the pages). public static IHtmlString PushPromiseStylesheet(this HtmlHelper htmlHelper, string src, bool addDomElement = true) { var context = HttpContext.Current; var path = System.Web.Optimization.Styles.Url(src).ToString(); var headers = new NameValueCollection { { "accept-encoding", context

Http2 - server-push with nodejs pushStream method do not working

非 Y 不嫁゛ 提交于 2019-12-06 12:29:59
问题 I am studying http2 on nodejs , but find out a issue pushStream method not working (client side do not show "Pushed/[fileName]" on developer tool) I wonder if the reason is nodejs version (i installed the latest version v9.8.0) My codes is the following : server.js 'use strict' const fs = require('fs'); const path = require('path'); const http2 = require('http2'); const utils = require('./utils'); const { HTTP2_HEADER_PATH } = http2.constants; const PORT = process.env.PORT || 3000; // The

ASP.Net HTTP2 PushPromise is slow

喜你入骨 提交于 2019-12-06 02:21:14
I'm trying to implement the Http2 push server functionality using "PushPromise" .NET 4.6.1, for this I have a "html extension" with Razor (we did not implement MVC only used the Razor engine to build the pages). public static IHtmlString PushPromiseStylesheet(this HtmlHelper htmlHelper, string src, bool addDomElement = true) { var context = HttpContext.Current; var path = System.Web.Optimization.Styles.Url(src).ToString(); var headers = new NameValueCollection { { "accept-encoding", context.Request.Headers["accept-encoding"] } }; context.Response.PushPromise(path, "GET", headers); var

Http2 - server-push with nodejs pushStream method do not working

梦想与她 提交于 2019-12-04 20:18:21
I am studying http2 on nodejs , but find out a issue pushStream method not working (client side do not show "Pushed/[fileName]" on developer tool) I wonder if the reason is nodejs version (i installed the latest version v9.8.0) My codes is the following : server.js 'use strict' const fs = require('fs'); const path = require('path'); const http2 = require('http2'); const utils = require('./utils'); const { HTTP2_HEADER_PATH } = http2.constants; const PORT = process.env.PORT || 3000; // The files are pushed to stream here function push(stream, path) { const file = utils.getFile(path); if (!file)