2 ms·
This is a really weird system you have devised. You are making a custom request to ask the server to push something to the browser. Browser: POST /preload?url
by kevincox 6y ago
This is a really weird system you have devised.
You are making a custom request to ask the server to push something to the browser.
Browser: POST /preload?url=/next-page
Server: PUSH /next-page
Just cut out the middleman and make a regular request.
Browser: GET /next-page
Even better use browser preloading mechanisms so that the browser knows how to best prioritize them. In fact if you do it this way the browser can even start downloading subresources and prerendering the page.
- Town0 6y agoWeird? Having the html downloaded for the link you're about to click, and used by the browser if the user clicks on the link, is by far the most balanced and simple implementation of prefetching. Everything is handled by the http2 push technology. No excessive javascript nonsense, no altering the Dom, and no downloading and prerendering of everything behind a link you might not even click. Absolutely flawless and perfect enhancement to a browsing experience so long as the spec allows for this.
- Town0 6y agoAre you saying that a simple javascript http request would get cached by the browser and used if the user clicks on the link? If so my apologies. I don't make websites yet. That would indeed do the same thing that I'm proposing.