« first day (2716 days earlier)      last day (2217 days later) » 

1:00 AM
@MarkKaplun does PHP support it?
hmmm you can probably do it via the theme, a plugin to do it for enqued stuff would be nice, the question though is how much would you know in advance before the first byte gets sent and headers are flushed?
 
 
3 hours later…
3:58 AM
@TomJNowell yes. if I got it right you just need to set link headers to communicate to the web server that it should push. Core right now sets links in the HTML header which is probably not enough.
hmmm, well that is another core problem, starting to flush before all the HTML is generated. havn't thought of it.
 
 
7 hours later…
11:15 AM
well you want that so you can do a fast ttfb
so you need to know what resources to link in advance
either by caching them on the first load so the next load gets it
or via filters and commonly used stuff
e.g. you can probably run through the loop before the template is loaded and add all the feature images to the header
 
 
5 hours later…
4:21 PM
it should be actually much simpler, buffer all output, set headers before flushing the buffer. Any reason it should not work?
images.... this is too complex, as you need to load CSS based images as well. When I have the time will start with CSS and JS set in the header of the page
CSS images will probably need to be explicitly "enqueued by the theme, but that is really too complex to even think about at this stage.
 
buffering all output is suboptimal though
 
 
2 hours later…
6:40 PM
@TomJNowell, It actually solves so many problems, for example redirect and "error" output when handling ajax. the performance penalty has to be truly bad to not use it.
 
what's the point in telling the browser to preload stuff via headers if you have to wait a second for those headers because of output buffers?
as well as the additional manual HTML parsing to figure out what resources are in the doc
instead, consolidate scripts and styles and push them out via header on the init hook, save which resources are in posts in their meta then push out those via header on the template_redirect hook using the main query
that should cover the majority of pushable resources
in the meantime the browser knows as fast as possible to fetch them, and is busy processing the sent HTML as it comes in at the same time
and fewer server resources and memory spent
nevermind that all it takes is somebody being overeager flushing output buffers to ruin the entire thing
 

« first day (2716 days earlier)      last day (2217 days later) »